Java Introduction and History

  • Java is an Object Oriented programming language developed by James Gosling and his team in 1991 at Sun Microsystems. Initially it was called Oak but later in 1995 changed to Java.
  • Java is compiled and interpreted language -

    java compilation and interpretation process
    fig: java compilation and interpretation process.

  • First of all compiler converts the java source code into a form called Byte Code. This is a file with .class extension and this Byte Code is called platform independent.
  • This Byte Code is interpreted by Java Virtual Machine (JVM) into executable code. Because JVM is available for almost every available device that's why Java is called platform independent language.
  • And this Byte Code also provides the security as well as portability to java language.
  • As java is compiled and interpreted language so one may think that its execution speed is slow than other compiled languages like C or C++. But there is not much difference because Byte Code is highly optimized and JVM can execute it much faster than you think.
  • Also JVM contain a JIT (Just In Time) compiler that in place of compiling the whole program, compiles only that part of the program that is needed at that time.

How Java came into existance

  • The primary motivation for developing the Java was to develop a platform independent language that can be used to create software's for consumer electronic devices like TVs, Microwave Oven, Remote control etc.
  • The reason behind this is that as different devices makes use of different types of controller so languages like C and C++ etc are not efficient for these types of software development because to run the software we need to design a full version of compiler for these languages for different types of devices available.
  • This is very time consuming and not an efficient solution.
  • Java provides efficient solution to this as java is platform independent i.e. can run on any device only we need JVM interpreter for that device.
  • After some time James Gosling and his team member realize that the same problem that java was initially designed to solve on a small scale could also be applied to the internet on large scale.
  • So they changed focus from consumer electronic devices to internet programming. And now it has been widely used in this field also.