DZone
DevOps Zone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
  • Refcardz
  • Trend Reports
  • Webinars
  • Zones
  • |
    • Agile
    • AI
    • Big Data
    • Cloud
    • Database
    • DevOps
    • Integration
    • IoT
    • Java
    • Microservices
    • Open Source
    • Performance
    • Security
    • Web Dev
DZone > DevOps Zone > Some of the JDK 1.7 Improvements in a Nutshell

Some of the JDK 1.7 Improvements in a Nutshell

Sam Kyatham user avatar by
Sam Kyatham
·
May. 24, 14 · DevOps Zone · Interview
Like (1)
Save
Tweet
5.09K Views

Join the DZone community and get the full member experience.

Join For Free

Following are the top 10 improvements impressed me over previous version of JDK. In a nutshell, I summarized below for quick look up.

  •  Underscores in Numeric Literals
   long ssn = 999_99_9999L
  • Strings in Switch Statements
String month = "Feb";
  switch(month) {
     case "January"  : <do some thing> ;break;
     case "February" : <do some thing> ;break;
     default : <do some thing> ;break;
  }
  • Automatic Resource Management

  Inout/Ouput streams need not be closed explicitly. JVM will take care of closing them when needed.

  Extended to classes which implements java.lang.AutoCloseable

  Syntax:

try( InputStream in = new FileInputStream(new File("text.txt"))){
     // your code
}
  • Multi-Catch Statements - group relevant types
try{
   ...
  } catch(InstantiationException | NoSuchMethodException | InvocationTargetException e){
     log(e);
  }     
  • New Enhanced IO package(NIO2)

Some of the new classes: java.nio.file.Paths, java.nio.file.Files, java.nio.file.FileSystem

features added to watch a directory for any changes, create a symbolic links, file copy is made easy.

  • Enhanced Concurrancy API
  • Bug Fixes on JAXP, JAX-WS, JAXB
  • JDBC 4.1

Connection, ResultSet and Statement = > now we don't need to close them manually as they implement AutoCloseable interface.

  • Fork and Join Framework
  • Diamond operator works many ways.
  Foo<Bar> bar=new Foo<>();


Java (programming language) Java Development Kit

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • Modernize Legacy Code in Production: Rebuild Your Airplane Midflight Without Crashing
  • Message Queuing and the Database: Solving the Dual Write Problem
  • An Introduction to Graph Data
  • Use Lambda Function URL To Write a Serverless App Backed by DynamoDB

Comments

DevOps Partner Resources

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • MVB Program
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends:

DZone.com is powered by 

AnswerHub logo