java - Why <> operator is not allowed for source below 1.7? -


in java program , have following line of code :

hashmap<string, string> query_args = new hashmap<>(); 

and receive following error:

'<>' operator not allowed source level below 1.7

i tried change project compliance , jre 1.7 eclipse not resolve imports. using jre 1.6.

any suggestions?

prior java 7 (1.7 here), needed do

hashmap<string, string> query_args = new hashmap<string, string>(); 

its referred diamond operator, , not backwards-compatible earlier versions of java.


Comments

Popular posts from this blog

ios - iPhone/iPad different view orientations in different views , and apple approval process -

java Extracting Zip file -

C# WinForm - loading screen -