Search
Calendar
May 2024
S M T W T F S
« Sep    
 1234
567891011
12131415161718
19202122232425
262728293031  
Your widget title
Archives

Posts Tagged ‘Dolphin’

PostHeaderIcon Java 7: Strings in Switch

Dolphin extends the switch operator to String

Read the rest of this entry »

PostHeaderIcon Java 7 diamonds

Tiger (Java 5) introduced new syntax, among which generics are the most used. Mustang (Java 6) did not offer anything new. Dolphin (Java 7) will introduce a new scheme, the “diamond syntax”. We deal of diamond because of the look of theses characters: “<>

To sum up quickly, in Java 5 we have to write:

List<Integer>  myList = new ArrayList<Integer>()
Map<String, List<Double>> myMap = new Hashmap<String, List<Double>>();

On last Dolphin development releases, we can simply write:

Lis<Integer> myList = new ArrayList<>()
Map<String, List<Double>> myMap = new Hashmap<>();

There’s nothing revolutionary, but developpers will save a little more time ;-).