Java New Features

“Java

  1. What are new features in Java 5?
  2. What are the new features in Java 6?
  3. What are the new features in Java 7?
  4. What are the new features in Java 8?

What are new features in Java 5?

New features in Java 5 are :

  • Generics
  • Enhanced for Loop
  • Autoboxing/Unboxing
  • Typesafe Enums
  • Varargs
  • Static Import
  • Concurrent Collections
  • Copy on Write
  • Compare and Swap
  • Locks

For more details about these new features, refer Core and Advanced Java Interview Questions.

What are the new features in Java 6?

Java 6 has very few important changes in terms of api’s. There are a few performance improvements but none significant enough to deserve a mention.

What are the new features in Java 7?

New features in Java 7 are :

  • Diamond Operator. Example : Map<String , List <Trade>> trades = new TreeMap <> ();
  • Using String in switch statements
  • Automatic resource management : try(resources_to_be_cleant){ // your code }
  • Numeric literals with underscores
  • Improved exception handling : Multiple catches in same block- catch(ExceptionOne | ExceptionTwo | ExceptionThree e)
  • File change notifications

What are the new features in Java 8?

New features in Java 8 are :

  • Lamda Expressions. Example : Runnable java8Runner = () -> { sop("I am running"); };
  • Nashorn : javascript engine that enables us to run javascript to run on a jvm
  • String.join() function
  • Streams

If you loved these Questions, you will love our PDF Interview Guide with 400+ Questions.
Download it now!.

400+ Interview Questions in 4 Categories:
  1. Java : Core Java, Advanced Java, Generics, Exception Handling, Serialization, Threads, Synchronization, Java New Features
  2. Frameworks : Spring, Spring MVC, Struts, Hibernate
  3. Design : Design, Design Patterns, Code Review
  4. Architecture : Architecture, Performance & Load Testing, Web Services, REST Web Services,Security, Continuous Integration