-3
private List<Manufacturer> productManufacturer = new LinkedList<Manufacturer>();

I am not able to understand why <> this symbol is here and Manufacturer inside it to define a LinkedList in Java.

hata
  • 11,633
  • 6
  • 46
  • 69
Aashish Sapkota
  • 49
  • 1
  • 10
  • 1
    Does this answer your question? [Java Generics (Wildcards)](https://stackoverflow.com/questions/252055/java-generics-wildcards) – Sync it Feb 10 '21 at 03:50

1 Answers1

3

Generics

Please read about generics

  private List<Manufacturer> productManufacturer = new LinkedList<>();

Assuming Manufacturer is a java class/interface/enum type, the above line defines a List that can hold only objects of type Manufacturer or its subclass types

Thiyanesh
  • 2,360
  • 1
  • 4
  • 11