Project Coin Features in Java 7
Project Coin Features in Java 7
Abhishek Asthana
Underscores in numbers
To improve readability.
try{
} catch (ExceptionA a|ExceptionB b|ExceptionC c){
// log and rethrow exception
}
Improved Type Inference
List<String> list1 = Arrays.asList(“a", “b"); //
inference
List<String> list2 = Collections.emptyList(); //
inference
List<String> list3 = new ArrayList<String>(); //
no inference
int hash(Object… values) : Compute a hash code for all the given
values
int hashCode(Object o) : If o is null return 0 otherwise return
o.hashCode()
java.util.Objects (contd.)
boolean equals(Object a, Object b) : Return true if the two
arguments are null or they are both not null and a.equals(b) return
true, otherwise false.