Wednesday, December 15, 2010

JDK 7 Features

JDK 7 Features
Project Coin : Small language enhancements

Its a time to think of new features in JDK, entire JAVA community closely watching the progress of JAVA/JDK development in Oracle. This release comes with small java language change to major featuristics. Following are few details of feature/changes

Strings in switch
void print(String s) { 
  switch (s) {
    case "hello":
      System.out.println("hello: "+s); 
      break;
    case "wow":
      System.out.println("wow: "+s); 
   break;
    default:
      System.out.println("Wrong option: "+s);
  }
}
Refer for more details in blog
Binary integral literals and underscores in numeric literals
Read here
Multi-catch and more precise rethrow
try {
    doWork(file);
} catch (final IOException|SQLException ex) {
    logger.log(ex);
    throw ex;
}
Refer for more details in mail archive
Improved type inference for generic instance creation (diamond)
Read mail archive
try-with-resources statement
Read here
Simplified varargs method invocation
Read here

Read following links to know more about the JDK SE 7.0 features. JDK 7 Project Coin: Project Page | mailing list | Joe Darcy and other Sun bloggers | wiki

1 comment:

Post a Comment

Recent Posts

Unix Commands | List all My Posts

Texts

This blog intended to share the knowledge and contribute to JAVA Community such a way that by providing samples and pointing right documents/webpages. We try to give our knowledege level best and no guarantee can be claimed on truth. Copyright and Terms of Policy refer blogspot.com