java - Java7 Type inference for generic instance creation? -


how can use java 7 type inference generic instance creation feature ? benefits use new style?

this known diamond operator. saves having write generic type arguments on instantiation of generic type. type arguments of instantiated generic type inferred type arguments present on declaration.

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

instead of:

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

Comments

Popular posts from this blog

javascript - DIV "hiding" when changing dropdown value -

Does Firefox offer AppleScript support to get URL of windows? -

android - How to install packaged app on Firefox for mobile? -