Saturday, 11 February 2017

Java History


Here we are adding brief history of java. Version by version new features and enhancement of java.

Java SE 12

New features in Java SE 12:
1.      Switch statement is changed to switch expression.
2.      Comparison of two files Files.misMatch(path, path)-
3.      New packge java.lang.constant which is part of JVM constant API
4.      New Method in java.io, InputStream skipNBytes(int n), will skip first N bytes.
5.      New method in String class, indent() and transform() method
6.    Compact Number Formatting- Now 10000 can be written as 10k
Refer below link for more details-

Java SE 10 & 11

New features in Java SE 10 & 11:
Java 10 was a minor release, it have few features like
1.      Improve in GC worst case latency by replacing it with full GC parallel.
2.    Removed native header generator javah

Java 11 Features-
1.    New method introduced in String - isBlank(), strip(), stripTrailing(), stripLeading(), repeat(int)
2.      Local variable type inference is introduced -  use var to declare the formal parameter of an implicit type lambda expression.
3.      For lambda var is used for implicit variable type. Here declare all parameter with var or none, also mixing with other type not allowed.
4.      New method in Files class, to read and write string, readString(), writeString()
5.      Pattern with predicate utility – asMatchPredicate() method is introduced and it will create a predicate if pattern matched a given input string.
Refer below link for more details-

Java SE 9

Released Date – July 27, 2017
Code name - …

New features in Java SE 9:
1.      Factory method for immutable collection (List, Set and Map) – Java introduces factory method for immutable collections, As: - List.of(), Set.of(), Map.of() etc.
2.    Private and Private static method on interface.
3.    Modular System. -   We can create module to overcome the limitation of monolithic jars.
4.    Improvement in process API – Introduces new classes and method to control and manage the OS processes.
5.    Improvement in Try with Resource – Improvement in try with resource now we can declare the resource outside the try-with-resource block.
6.    JSHELL – Jshell(Read evaluate print loop), here we can execute the function and code directly in jshell instead of writing complete java classes and methods.
7.    Reactive Stream. – To support reactive programming java introduces reactive stream like, Flow, Publisher, Subscriber, Processor to support it
8.    Improvement in Stream API – Introduces new methods in Stream API, dropWhile() and takeWhile(), these methods are useful in functional style code.
9.    CompletableFuture API Improvement - Now we can add delay, via using static utility method delayedExecutor().
The new features of JAVA 9 are announced, please follow the below link-
Refer below link for more details-

Java SE 8

Released Date - Mar 18, 2014
Code name - going forward from Java 8

New features in Java SE 8:
1.      Lambda Expressions – lambda expression is an introduction functional programming in java. Lambda expression is an anonymous function, it contains a set of parameter lambda operator -> and a function body.
2.      Pipelines and Streams – pipelines is sequence of aggregate operations while stream carries values from a source through pipelines
3.      Default Methods – Interface can have static and default method implementation to overcome the forced implementation of all method in class.
4.      Functional Interface – Functional interface can have exactly one abstract method and any no of default and static method. The purpose of functional interface to use lambda expression and avoid bulky anonymous class implementation.
5.      Date and Time API - new date and time API is introduced to overcome the thread safety and potential concurrency issue. In new API core classes are immutable and represents well-defined values. It contains precise domain uses with different calendaring system.
6.      Type Annotations - Type Annotations allow developers to write annotations in more places than before. Few type of annotation like @NotNull, @ReadOnly, @Regex etc.
7.      Concurrent Accumulators and Adder- Accumulator and adder are used for numeric counter instead of Atomic variables would spin, continuously retrying the CAS in an infinite loop until it succeded.
8.    Parallel operations – parallel operations helps to speed up the different operation as numeric computations
9.      Nashhorn JavaScript Engine – it’s is java script engine which directly compile the code in memory passes the bytecode in JVM.Nashhorn. Java 8 introduces new command line code jjs to execute java script code.
10. PermGen Error Removed - permgen is completely removed and replace with Metaspace to avoid java.lang.OutOfMemoryError  error, tune and monitoring of PermGen memory space. Metaspace is allocated out of native memory and it’s dynamically resize as per usage.

Java Version SE 7

Released Date - July 28, 2011
Code name - Dolphin

New features in Java SE 7
1.      Strings in switch Statement – We can use string in switch statement.
2.      Type Inference for Generic Instance Creation -  can substitute the parameterized type of the constructor with an empty set of type parameters (<>)
3.      Multiple Exception Handling - Now we can catch multiple exception in single catch block with pipe () separation.
4.    Support for Dynamic Languages – Now dynamic language like JRuby, JyThon can run extremely fast in JVM.
5.      Try with Resources – Now we can add auto closeable resource in try block.
6.      Binary Literals, underscore in literals – Now underscore supported in numeric literal but it will between digits, but not in beginning or end or adjacent to decimal point.
7.      Integral types (byte, short, int, and long) can also be expressed using the binary number system
8.      Automatic null Handling – Java 7 provide a way to null handling in nested object like obj?.getObj()1?.getObj2() it will check obj is not null than getObj1() and then getObj2()
Note – Automatic null Handling was a proposal but it was not in final release.

Java Version SE 6

Released Date – Dec 11, 2006
Code name - Mustang

New features in Java SE 6
1.      Scripting Language Support
2.      JDBC 4.0 API
3.      Java Compiler API
4.      Pluggable Annotations
5.      Native PKI, Java GSS, Kerberos and LDAP support.
6.      Integrated Web Services.
Refer oracle java docs for more details - java-1.6-OracleDocs

J2SE Version 5.0

Released Date - Sep 30, 2004
Code name - Tiger

New features in J2SE 5.0
1.      Generics – It provide the generic features to avoid compile time type safety.
2.      Enhanced for Loop - provide foreach loop to iterate over collection directly.
3.      Autoboxing/Unboxing – boxing and unboxing of primitive type in wrapper classes.
4.      Typesafe Enums – Enumeration are added in JAVA 5. Enums are implicit final subclasses
5.      Varargs -  varargs are added like methodVarargs(int…x)
6.      Static Import – we can directly import the static content.
7.      Metadata (Annotations) – Annotation a form of metadata, it’s provide data about a program
8.      Instrumentation – Instrumentation is the addition of byte code for the purpose of gathering the data for monitoring agents, profilers, and coverage and event logger tools.
9.      Covariant return type- covariant return type is the subtype return in place of supertype return.
10. StringBuilder- to concatenate a string we can use string builder as string operation are not safe, for example str1+str2+str3, this will create 5 object in heap so it’s better to use StringBuilder object, althought StringBuilder is not thread safe.
Refer oracle java docs for more details - java-1.5-OracleDocs

J2SE Version 1.4

Released Date - Feb 6, 2002 (first release under JCP).
Code name - Merlin

New features in J2SE 1.4
1.      XML Processing
2.      Java Print Service
3.      Logging API
4.      Java Web Start
5.      JDBC 3.0 API
6.      Assertions
7.      Preferences API
8.      Chained Exception
9.      IPv6 Support
10. Regular Expressions
11. Image I/O API

J2SE Version 1.3

Released Date - May 8, 2000
Code name - Kestrel

New features in J2SE 1.3
1.      Java Sound
2.      Jar Indexing
3.      Improved applet caching

J2SE Version 1.2

Released Date - Dec 8, 1998
Code name – Playground

New features in J2SE 1.2
1.      Collections framework.
2.      Java String memory map for constants.
3.      Just in Time (JIT) compiler.
4.      Jar Signer for signing Java ARchive (JAR) files.
5.      Policy Tool for granting access to system resources.
6.      Java Foundation Classes (JFC) which consists of Swing 1.0, Drag and Drop, and Java 2D class libraries.
7.      Java Plug-in
8.      Scrollable result sets, BLOB, CLOB, batch update, user-defined types in JDBC.
9.      Audio support in Applets.
10. Weak references
11. Java interface definition language (IDL)
12. Javadoc templates

JDK Version 1.1

Released Date - February 19, 1997

New features in JDK 1.1
This was the first enhancement after initial release,
1.      JDBC (Java Database Connectivity)
2.      Inner Classes
3.      Java Beans
4.      The Java Archive (JAR) file format
5.      A Math package
6.      Object serialization
7.      RMI (Remote Method Invocation)
8.      Reflection (introspection only)

JDK Version 1.0

Released Date - Jan 23, 1996
Code name - Oak.

First release, everything is new J


6 comments: