Introduction to Java
Java is a high-level programming language that follows object-oriented programming principle. The main motto of Java programming language is "write once run anywhere." The syntax and semantics of Java are very much similar to C and C++ programming language.
What is Java
Java is considered a programming language and a platform. As a programming language, it is a general-purpose, object-oriented high-level programming language that has its own syntax and style. As a platform, it provides an environment in which Java applications run.
Java has four different platforms-
- Java Standard Edition (Java SE)- In general, most of the programmers use Java SE to do programming in Java. It provides the core functionality of the Java language. APIs that are used for database access, GUI development, networking, etc. are present in this platform.
- Java Enterprise Edition (Java EE)- This platform is used to develop and run reliable, secure and large-scale network applications. It is built on the top of Java SE.
- Java Micro Edition (Java ME)- This platform is suitable for small devices like smartphones. It is a subset of Java SE and provides API applicable for application development on small appliances. It has small footprint virtual machine that enables Java applications to run smoothly on less memory constrained devices.
- JavaFX- It is used to create rich internet applications. You can think JavaFX as an alternate of Swing. It helps programmers to create applications with modern look-and-feel and utilize hardware-accelerated graphics.
Note- All Java platforms has a JVM and an API. Java Virtual Machine(JVM) is a program designed for a particular hardware and software, that runs applications written in Java. An API is a collection of library that helps developers to create applications or software.
History of Java
James Gosling is known as the father of the Java. He along with his two teammates 'Patrick Naughton' and 'Mike Sheridan' created Java programming language at Sun Microsystems. They decided to name this new programming language as Oak. Later they changed it to Java.
Java versions History
Java Versions |
Codename |
Release Date |
JDK Alpha and Beta |
- |
1995 |
JDK 1.0 |
- |
23rd January, 1996 |
JDK 1.1 |
- |
19th February, 1997 |
J2SE 1.2 |
Playground |
8th December, 1998 |
J2SE 1.3 |
Kestrel |
8th May, 2000 |
J2SE 1.4 |
Merlin |
6th February, 2002 |
J2SE 5.0 |
Tiger |
30th September, 2004 |
Java SE 6 |
Mustang |
11th December, 2006 |
Java SE 7 |
Dolphin |
7th July, 2011 |
Java SE 8 |
Spider |
18th March, 2014 |
The name of earlier versions of Java started with JDK. From version 1.2 onwards, Sun shifted to J2SE. Versions 1.2 to 1.4 are known as Java 2. Version 1.5 is also called Java 5, J2SE 5 or J2SE 1.5. From 1.6 version onwards, Sun replaced J2SE with Java SE.
Sun released 22 updates for J2SE 5.0. Oracle released 54 updates for Java SE 6.
Features of Java
Java has many features that are collectively known as Java Buzzwords. These features are explained below-
- Simple- Java removed confusing and ambiguous features of other programming languages.
- Robust- Java provides error checking at the compile time and dynamic checking at runtime. Memory management, type checking, exception handling, garbage collection, etc. make Java a robust programming language.
- Portable- There are no platform-dependent aspects in Java language. Thus, Java programs can run on all the different operating system like Windows, Linux, and Mac without making any changes to the source code. For example, the size of primitive data types remains same on all the different operating system.
- Architectural Neutral- The Java compiler compiles the source code into bytecode, which does not depend upon the machine architecture. The bytecode can be executed on any machine.
- Platform Independence- Your Java code runs on JVM which means the same source code can run on any operating system's JVM and get the same result every time.
- Object-Oriented- Java is an object-oriented programming language by implementing features of OOPS such as abstraction, encapsulation, inheritance and polymorphism.
- Multithreaded- Java uses JIT(Just-In-Time) compiler to improve the performance of bytecode interpretation by caching the interpretations.
- High performance- Java enables a programmer to create a multithreaded application.
- Distributed- Java allows you to access files over the internet by calling methods. With the help of RMI and EJB, you can create distributed applications.