Wednesday, 16 November 2011

Java 7 Latest Release Features


Java 7 released in July and yes most of the people started to use the same. It has very cool features which are really useful for development. 




1. Strings in switch Statements 



  1.    switch (direction) {  
  2.          case "up":  
  3.              y--;  
  4.          break;  
  5.   
  6.          case "down":  
  7.              y++;  
  8.          break

2. Type Inference for Generic Instance Creation 



  1. List<String> strings = new ArrayList<>();  



3. Multiple Exception Handling Syntax




  1. catch (ClassNotFoundException | IllegalAccessException |  
  2.    InstantiationException ex) {  
  3. }

4. The try-with-resources Statement


try (BufferedReader in=new BufferedReader(new FileReader("test.txt")))  {


}


5. Improved File IO API

6. Support for Non-Java Languages: invokedynamic

7. JLayerPane

No comments:

Post a Comment