Plan du site  
pixel
pixel

Articles - Étudiants SUPINFO

The evolution of Java language

Par Franck LANDUYT Publié le 04/05/2019 à 16:06:04 Noter cet article:
(0 votes)
Avis favorable du comité de lecture

Introduction

In this article we will study the different versions of Java from 1.0 to the last version on 12. Java is a general purpose, advanced and object-oriented programming language with syntax close to C, C++ and C#. Its characteristics as well as the richness of its ecosystem and community have allowed it to be widely used for the development of web applications with J2EE for many years. Java is widely used for the development of enterprise and mobile applications. Indeed, Java Language is one of the most widely used languages in the world, it is used by all Android systems, more than 97% of desktop computers in 2019 have a JVM (Java Virtual Machine that allows to launch applications in Java) installed, it is downloaded more than a billion times per year and it is one of the languages where there are the most developers available.

The Java Logo

import java.lang.Math;

public class HelloWorld
{
  public static void main(String[] args)
  {
    OtherClass myObject = new OtherClass("Hello World!");
    System.out.print(myObject);
    System.out.print("\nLorem ipsum dolor sit amet, consectetur adipiscing elit. Ut at justo arcu. Sed cursus nisl facilisis nisl lacinia fermentum. lentesque ex.");
  }
}

public class OtherClass
{
  private String message;
  public OtherClass(String input)
  {
    message = "Why, " + input + " Isn't this something?";
  }
  public String toString()
  {
    return message;
  }
}

Java code

Java 1.0

Java is an object-oriented programming language, created by James Gosling and Patrick Naughton then employed by Sun Microsystems in May 1995. So it was the JDK 1.0 version under the name Oka project. In this version there is mainly the initiation of Java topography, and there were only eight packages ( class set) available :

java.lang : basic classes

java.util : utilities

java.io : input/output management through flows

java.net : management of communications across the network

java.applet : applets

java.awt.peer : interaction with the operating system for displaying graphic components

java.awt.image : image manipulation

This version of Java is no longer supported since 2000 and its last update was version 1.0.2

Java 1.1

We can say that Java version 1.0 was the beta version, here is the real version 1 which is available since February 1997 this version has no code name. There are many additions in this version, we can mention the most famous ones such as the appearance of JavaBeans (it is a class that respects naming and construction conventions), a complete redesign of the AWT library ( allows to make windows for applications), JAR files (Zip file that allows to execute Java code), the fact of being able to make several classes in the same Java file, adding the JDBC (database management) and the Java Remote Invocation .

This version has not been supported since 2000 and its last update was 1.1.8_16.16.

public class JavaBean implements Serializable {
                                                                                                                                                      
 //  private attributes
 private String proprieteNumero1;
 private int proprieteNumero2;
                                                                                                                                                       
    // Default constructor (No arguments) 
    public JavaBean() {
    }
                                                                                                                                                      
                                                                                                                                                        
 // access methods
                                                                                                                                                      
 public String getProprieteNumero1() {
  return this.proprieteNumero1;
 }

 public int getProprieteNumero2() {
  return this.proprieteNumero2;
 }

 public void setProprieteNumero1( String proprieteNumero1 ) {
  this.proprieteNumero1 = proprieteNumero1;
 }

 public void setProprieteNumero2( int proprieteNumero2 ) {
  this.proprieteNumero2 = proprieteNumero2;
 }

}

An example of a JavaBean class

Java 1.2

Java version 2 was released on December 9, 1998 under the code name Playground. This is the first version to be really named Java, in fact before we talk about JDK 1.0 and 1.1. In this version is included J2SE (Java 2 Platform, Standard Edition) which replaces JDK to distinguish the basic platform from the J2EE version (Java 2 Platform, Enterprise Edition) and the J2ME version (Java 2 Platform, Micro Edition). In this new version, there were many additions: the possibility to create graphical user interfaces using the Swing API, for the first time you can see your errors before compiling thanks to the addition on the JVM of a "Compilation on the fly" compiler. New audio formats are supported, adding Array and reflections (the program can modify itself its own high-level internal structures during its execution.).

This version of Java is no longer supported since 2006 and its last update was 1.2.2_017.

import java.util.ArrayList;
 
public class Test {
                                                                                                                                                       
  public static void main(String[] args) {
    // we define the Array  
    ArrayList collection = new ArrayList();
    // we add elements in it 
    collection.add(01);
    collection.add("ffefefefeffefefef");
    collection.add(0.001);
    collection.add('a');
    collection.add('p');            
    for(int i = 0; i < collection.size(); i++)
    {
      System.out.println("n= " + i + " = " + collection.get(i));
    }               
  }
}

A Array in Java

Java 3

The third version of Java (Java 3) was released under the code name Kestrel in May 2000. The main changes are a greatly improved speed of execution, a new virtual machine that is called JVM Hotspot, the addition of Java Sound, JPDA (Java Platform Debugger Architecture) and JNDI (Java Naming and Directory Interface that allows access to naming or directory services).

This version has not been supported since 2001 and its last update was 1.3.1_29.

Java 4

Java version 4 was released on February 6, 2002 under the code name Merlin. It brings many improvements, especially in terms of performance and new functionalities, including: the addition of a new java keyword to allow assertions that is "assert", the new version of JDBC, the Image I/O API to read, the ability to use Xml in your projects thanks to JAXP, APIs to use regular expressions, user preferences and cryptography, being able to make chain exceptions and write images in formats like JPEG and PNG and Java Web Start ( allows to launch applications create Java directly from a web browser).

This version has not been updated since 2008 and its last deployed version is 1.4.2_30.

Java 5

On September 30, 2004, the fifth version of Java was released under the code name Tiger. This version brings many new features, we can start by mentioning the default addition of Java Web Start in the Java runtime environment, generic programming has been added, the addition of Meta data that allows you to add metadata to your Java code, this data can be used by classes, methods, parameters, local variables, attributes and packages. We can also note the addition of enumerations (ordered list of values) with the keyword "enum". There is also the addition of varargs with the "Object" syntax which allows in a method declaration to specify a variable number of arguments for this method, the addition of Autoboxing/unboxing (automatic conversion to Int to the corresponding class), static imports or even the redesign of the "for" for loops. In addition to these additions, many methods in Java version 1.0 were declared deprecatory and subsequently deleted.

public enum age {
  John("42"),
  Jane ("55")
  Steve("20")
  Bill ("22")
}

An enumeration.

This version is no longer supported since May 2015 and its last update was 1.5.0_85 .

Java 6

Java 6 was released as Mustang on December 12, 2006 in final version. There are very few new features in this version, however we can notice a clear performance gain of 20% for applications running in Java. However, this version of Java is well known for its many security vulnerabilities when released, which multiplied the number of patch updates for this version. It was partly because of these problems that Apple abandoned the Java language for its software and decided to create its own language (Swift). The last update of this version was made in 2013.

This version was supported by Oracle (which bought Java in 2009) until December 2018 and its last update is 1.6.0_111. However, its use is not recommended for new projects, as it is declared obsolete.

Java 7

Java version 7 or its Dolphin code name was released on July 7, 2011. It will mark the return of Java to Apple however, Apple does not provide Java updates and therefore lets Oracle support them so we can code again under Mac OS for Java. There are some new features with this version: binary notation, making switches with strings, multi catch, a new user interface and an important performance gain especially in heavy calculations. Version 0_79 of April 2015 is the latest update of Java 7 available to date.

public String week(String joursemaine) {
     String day;
	                                                                                                                                            
     switch (dayWeek) {
                                                                                                                                      
         case "Monday":
             day = "Start of work week";
             break;
         case "Tuesday"
         case "Wednesday":
         case "Thursday":
             day = "Midweek";
             break;
         case "Friday":
             day = "End of work week";
             break;
         case "Saturday":
         case "Sunday":
             day = "Weekend";
             break;
         default:
             throw new IllegalArgumentException("Invalid day of the week: " + dayOfWeekArg);
                                                                                                                                           		
     }
	                                                                                                                                            
     return day;
}

A switch with strings.

This version, which is not yet used much nowadays even if it is not recommended to use, its support should stop in July 2022 and its last current stable version is 1.7.0_79.

Java 8

This version of Java, known as Kenaï code and available from March 2014, however the J2EE 8 version is only available since 2017. The main new feature of this version is the addition of lambdas which allows proud people to calculate without having to give them a name. There was also the redesign of the API, which is now dated and, as often happens, a performance gain. The latest version of Java 8 is 1.8.0_212.

This is one of the most used versions of Java and the termination of its support is not yet specified.

Java 9

Java version 9 was released on September 21, 2017, 2 years late. It provides better management of the heaviest projects and a 40% more efficient JVM and the addition of Link (a tool that can assemble and optimize a set of modules and their dependencies in a customized uptime image. It allows to produce a fully usable executable, including the Java virtual machine to run it). Its latest version is the 9.0.4 released in 2018.

Java 10

The version of Java (10) was made available on March 20, 2018, i.e. less than a year has passed since the release of version 9 (September 21, 2017). The main cause is Oracle's willingness to adopt a train release system. With this new system, Java will be updated every six months. Indeed, as soon as a new feature is available, it will enter the pre-production phase and then be validated and integrated into the final update. Previously, Java was updated every two or even three years when all the features were completed and available: this was called "system feature release". The main new feature of Java 10 is the introduction of the keyword "var" instead of the standard variable declaration, within a method. The keyword "var" can also be used in "for" or "try/catch" block declarations.

//before                                                                                                                                               
                                                                                                                                                      
String str = new String ;                                                                                                                             
str = "Lorem ipsum dolor sit amet, consectetur adipiscing elit.";                 
                                                                                                                                                      
//from Java 10                                                                                                                                 
                                                                                                                                                      
var str = "Donec finibus ligula nec nibh convallis pulvinar.";                     

Some exceptions:

var test ; // variable initialization.                                                                                                            
                                                                                                                                                      
var test = "hello", test2 = " Bonjour"; // declaration of several variables impossible.                                                              
                                                                                                                                                      
var tableau = {"John","Doe", "Jane","Doe",}; //you need an explicit type.                                                                             
                                                                                                                                                      
var test = 1 ; test = "hello"; //you can't transform a var already used.                                                                     

Java 11

The penultimate version of Java is version 11, it was released in September 2018. The main new features of this version are: the improvement of the declaration of variables started with Java 10, the simplified launch of a Java file, Unicode 10 (apis management) and the update of the http client API (Java 9).Its latest version is the 11.0.3.

//before                                                                                                                                             
                                                                                                                                           
javac -d <memory> MyProgram.java
java -cp <memory>                                                                                                                                                    
               
                                                                                                                                                      
//from Java 11                                                                                                                                 
                                                                                                                                                      
java MyProgram.java                   

Java 12

The latest version of Java to date is version 12, it has been available since March 2019. From this version Oracle will publish monthly updates of Java versions (Version 13 can already be tested in beta). The main new feature is a new switch syntax. The latest version is 12.0.1 .

//before  
                                                                                                                                           
switch (dayWeek) {
                                                                                                                                           
         case "Monday":
             day = "Start of work week";
             break;
         case "Tuesday"
         case "Wednesday":
         case "Thursday":
             day = "Midweek";
             break;
         case "Friday":
             day = "End of work week";
             break;
         case "Saturday":
         case "Sunday":
             day = "Weekend";
             break;
     }          
                                                                                                                                                      
//from Java 12  

 switch (dayWeek) {   
                                                                                                                                             
    case "Monday" -> day = "Start of work week";
    case "Tuesday","Wednesday","Thursday" ->  day = "Midweek";
    case "Friday" -> day = "End of work week";
    case "Saturday" ,"Sunday" -> day = "Weekend";
                                                                                                                                           
}                                                                                                                                                                                                                                                                                          

The switch is easier to read

Conclusion

Finally, Java is a language in constant evolution and is always updated. From version 1.0 to version 12, many new features have allowed Java to become a complete language and to become one of the most widely used languages in companies, it is even used for Android, which is the most widely used mobile operating system and in Web applications.

A propos de SUPINFO | Contacts & adresses | Enseigner à SUPINFO | Presse | Conditions d'utilisation & Copyright | Respect de la vie privée | Investir
Logo de la société Cisco, partenaire pédagogique de SUPINFO, la Grande École de l'informatique, du numérique et du management Logo de la société IBM, partenaire pédagogique de SUPINFO, la Grande École de l'informatique, du numérique et du management Logo de la société Sun-Oracle, partenaire pédagogique de SUPINFO, la Grande École de l'informatique, du numérique et du management Logo de la société Apple, partenaire pédagogique de SUPINFO, la Grande École de l'informatique, du numérique et du management Logo de la société Sybase, partenaire pédagogique de SUPINFO, la Grande École de l'informatique, du numérique et du management Logo de la société Novell, partenaire pédagogique de SUPINFO, la Grande École de l'informatique, du numérique et du management Logo de la société Intel, partenaire pédagogique de SUPINFO, la Grande École de l'informatique, du numérique et du management Logo de la société Accenture, partenaire pédagogique de SUPINFO, la Grande École de l'informatique, du numérique et du management Logo de la société SAP, partenaire pédagogique de SUPINFO, la Grande École de l'informatique, du numérique et du management Logo de la société Prometric, partenaire pédagogique de SUPINFO, la Grande École de l'informatique, du numérique et du management Logo de la société Toeic, partenaire pédagogique de SUPINFO, la Grande École de l'informatique, du numérique et du management Logo du IT Academy Program par Microsoft, partenaire pédagogique de SUPINFO, la Grande École de l'informatique, du numérique et du management

SUPINFO International University
Ecole d'Informatique - IT School
École Supérieure d'Informatique de Paris, leader en France
La Grande Ecole de l'informatique, du numérique et du management
Fondée en 1965, reconnue par l'État. Titre Bac+5 certifié au niveau I.
SUPINFO International University is globally operated by EDUCINVEST Belgium - Avenue Louise, 534 - 1050 Brussels