Possible Duplicate:
In a Java 7 multicatch block what is the type of the caught exception?
In Java SE 7 it is possible to catch multiple types of exception:
catch (IOException|SQLException ex) {
logger.log(ex);
throw ex;
}
Is there any other usage of such syntax?
Can I create unions with this syntax, like
public void main() {
Integer|Boolean a;
a=true;
a=Integer.Zero;
}
or may be I can use this to derive multiple interfaces anonymously, like
public void main() {
Object o = new List<Integer>|Comparable<List<Integer>>() {
// here implementing both interfaces...
}
}