| 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 | |
|
|
|
- switch (direction) {
- case "up":
- y--;
- break;
-
- case "down":
- y++;
- break;
|
| 2. Type Inference for Generic Instance Creation | | | | |
|
|
|
- List<String> strings = new ArrayList<>();
|
| |
|
| 3. Multiple Exception Handling Syntax |
|
|
|
|
- catch (ClassNotFoundException | IllegalAccessException |
- InstantiationException ex) {
- }
|
| 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