Being just a beginner in JAVA, I am unable to understand the difference between the two. Both the codes were working perfectly in my Eclipse program.
Asked
Active
Viewed 50 times
0
-
There is no difference. The latter (aka the diamond operator) is only supported since Java 7. – Eran Jul 17 '16 at 09:31
-
Also you can read : http://stackoverflow.com/questions/38346510/propper-initialization-of-an-arraylist and http://stackoverflow.com/questions/17033206/is-there-a-difference-between-explicitly-putting-the-type-into-the-diamond-opera @T.J.Crowder Thanks for reminding the dupe. – Suresh Atta Jul 17 '16 at 09:41