Java 7 – New featuresEverything you wanted to know about Java7 http://arraylist.blogspot.com
Java 7 – New featuresString data type in the switch block for the switch-case statement.public void getArea(FloorPlan fp) ...
Java 7 – New featuresEnhanced catch block in the try-catchstatement. A single catch block to catch multipleexception - whe...
Java 7 – New featuresCollections api introduces - A lightweightfork/join framework.More classes –Phaser - a resuable and f...
Java 7 – New featuresImproved Diamond(<>) operator in generics where thedata type inside the <> generic operator of the le...
Java 7 – New featuresNumerical literalsLong numbers are easier to read and neatlyidentified using numerical literalsNow 1 ...
Java 7 – New featuresThe enhanced try statement astry-with-resourcetry(FileInputStream fis = newFileInputStream("somefile....
Java 7 – New features    For more interesting stuff visit      http://arraylist.blogspot.comhttp://arraylist.blogspot.com
Upcoming SlideShare
Loading in …5
×

New features in Java 7

2,572 views

Published on

Java 7 has introduced many new features - language level additions,improvement in JDBC api, additions to the collections api and more.This presentation gives you a quick and important introduction to the new features.

Published in: Technology, News & Politics
1 Comment
2 Likes
Statistics
Notes
No Downloads
Views
Total views
2,572
On SlideShare
0
From Embeds
0
Number of Embeds
9
Actions
Shares
0
Downloads
50
Comments
1
Likes
2
Embeds 0
No embeds

No notes for slide

New features in Java 7

  1. 1. Java 7 – New featuresEverything you wanted to know about Java7 http://arraylist.blogspot.com
  2. 2. Java 7 – New featuresString data type in the switch block for the switch-case statement.public void getArea(FloorPlan fp) { String shape = fp.getShape(); switch (shape) { case SQUARE: calculateArea(fp.getLength()); break; case RECTANGLE: calculateArea(fp.getLength() * fp.getBreadth()); break; default: break; } }http://arraylist.blogspot.com
  3. 3. Java 7 – New featuresEnhanced catch block in the try-catchstatement. A single catch block to catch multipleexception - where the exceptions are separatedby pipes.try { someMethod(); }catch (ExceptionA | ExceptionB | ExceptionC e){ // handle exceptions }http://arraylist.blogspot.com
  4. 4. Java 7 – New featuresCollections api introduces - A lightweightfork/join framework.More classes –Phaser - a resuable and flexiblesynchronization barrierThreadLocalRandom – generates a randomnumber dedicated to the present thread.Interfaces - ConcurrentLinkedDeque,TransferQueue .http://arraylist.blogspot.com
  5. 5. Java 7 – New featuresImproved Diamond(<>) operator in generics where thedata type inside the <> generic operator of the left handside is automatically inferred to the right hand side toimprove readability and reduce code clutter.for example :-//previouslyList<Integer, List<String>> list = new ArrayList<Integer,List<String>>();//in jdk7List<Integer, List<String>> list = new ArrayList<>();http://arraylist.blogspot.com
  6. 6. Java 7 – New featuresNumerical literalsLong numbers are easier to read and neatlyidentified using numerical literalsNow 1 million can be declared in a morereadable way.Old int onemillion = 1000000;Newint onemillion = 1_000_000;http://arraylist.blogspot.com
  7. 7. Java 7 – New featuresThe enhanced try statement astry-with-resourcetry(FileInputStream fis = newFileInputStream("somefile.txt")){ //do something}http://arraylist.blogspot.com
  8. 8. Java 7 – New features For more interesting stuff visit http://arraylist.blogspot.comhttp://arraylist.blogspot.com

×