I am a beginner in java and just getting into collection framework,
an arraylist can be declared a few ways like
List<String> list=new Arraylist<>();
or
Arraylist<String> list=new Arraylist<>();
each of them with or without the diamond brackets.
I Wanted to ask what are the differences between the two declarations and why use the diamond brackets if it is not needed.