New Features in Java

New Features in Java

There are many new features that have been added in java. There are major enhancement made in Java5, Java6, Java7 and Java8 like auto-boxing, generics, var-args, java annotations, enum, premain method , lambda expressions, functional interface, method references etc.

Most of the interviewers ask questions from this chapter.

Do You Know?
  1. How to create generic class and generic method in java ?
  2. What is annotation and how to create custom annotation ?
  3. What is the advantage of assertion and where we should not use it ?
  4. What is variable argument and what rules are defined for variable argument ?
  5. What is the difference between import and static import ?
  6. How autoboxing is applied in method overloading. Which concept beats autoboxing ?
  7. What is enum type and how to specify specific value to the enum constants ?



JavaSE 8 Features

The important features of JavaSE 8 are lambda expressions, methods references, default methods, functional interface, java 8 date/time, stream classes etc.


JavaSE 7 Features

The important features of JavaSE 7 are try with resource, catching multiple exceptions etc.

  • String in switch statement (Java 7)
  • Binary Literals (Java 7)
  • The try-with-resources (Java 7)
  • Caching Multiple Exceptions by single catch (Java 7)
  • Underscores in Numeric Literals (Java 7)

JavaSE 6 Features

The important feature of JavaSE 6 is premain method (also known as instrumentation).

  • Instrumentation (premain method) (Java 6)

J2SE 5 Features

The important features of J2SE 5 are generics and assertions. Others are auto-boxing, enum, var-args, static import, for-each loop (enhanced for loop etc.


J2SE 4 Features

The important feature of J2SE 4 is assertions. It is used for testing.

原创文章,作者:ItWorker,如若转载,请注明出处:https://blog.ytso.com/263789.html

(0)
上一篇 2022年6月1日
下一篇 2022年6月1日

相关推荐

发表回复

登录后才能评论