java - Unchecked assignment when initializing a list -


this question has answer here:

what difference between

list<string> list = new arraylist(); 

and

list<string> list = new arraylist<>(); 

?

in first case, ide highlights , says "unchecked assignment", seem behave same.

no difference, java compiler figure out type, better add inferred type argument:

list<string> list = new arraylist<string>(); 

Comments

Popular posts from this blog

filehandler - java open files not cleaned, even when the process is killed -

java - Suppress Jboss version details from HTTP error response -

gridview - Yii2 DataPorivider $totalSum for a column -