Java is a programming language that was developed by the team led by James Gosling and Patrick Naughton at Sun Microsystems in 1991. The public version of Java was first released four years later in 1995. As Sun Microsystems was acquired and taken over by Oracle, Java is today steered and authoritatively handled by Oracle. Java is regarded as a simple programming language based on object oriented approach which makes it easier to reuse code fragments as well as debug programs. Today, Java is the base of many advanced operating devices due to its modular programming ability. So here, we start with our first tutorial of Java with a brief Introduction to Java as a programming language.
Basic terminologies and important terms
Before you go ahead with the programming in Java, it is equally important to understand Java terminologies and basics as to how and why Java is distinct in its aspect. For this, let us first understand the Java Development Kit (JDK), Java virtual Machine (JVM) and Java Runtime Environment (JRE).
• JVM or Java Virtual Machine
We all understand what a computer is and how a program runs on it. The concept of Java Virtual Machine is very similar to that of a computer, the only difference being it involves no hardware. The Java Virtual Machine can be understood as the software implementation of the computer to run programs. It is because of the specific coding and designing of the JVM that the user is able to implement the code in different OS.
• Java Runtime Environment
The JRE comprises of the Java Virtual machine as well as the different Java class libraries. All of these contain the necessary functions as well as other key factors that are essential for java programs.
• Java Development Kit
The Java Development Kit comprises of JRE and some additional tools that are needed to run Java programs. Hence, the compiler, JVM, class libraries and the tools make up the Java Development Kit.
Bytecode- This is one of the specialties of Java as a programming language that provides Java the edge over other programming languages. The Java compiler when compiles a Java program, changes it to bytecode which is secure. This bytecode is later interpreted and executed by the Java Virtual Machine.
Why go with Java?
There are indeed many programming languages such as C, C++, COBOL, FORTRAN, etc. and thus the question arises – what is the need to study or learn JAVA or how is it different from all the others? Here are some of the key features of Java as a programming language which would help you answer the above question.
- Platform Independent – Java is a platform independent language. A platform can be considered as an existing environment with constraints and facilities that have to be followed and used by the program. When we say that Java is platform independent, this means that irrespective of the platform we combine the Java program, the byte code of the program can be run on any platform be it Linux, Windows, Mac OS, etc.
- It is Object Oriented- An object is an instance of a class and in the object oriented approach of programming; the programs are organized on the basis of object collection. The key features of object oriented approach are as follows-
a. Data Abstraction (Restricting access and hiding)
b. Data Encapsulation (Putting related data and members in one block)
- Simple- Java does not include complex working features of operator overloading, confusing multiple inheritance and memory allocation in explicit manner and thus, it is way simpler as compared to others.
- Java is Robust- Two of the most common errors due to which the program meets a failure in compilation and execution are memory management errors and runtime error mishandling. But in the case of Java, these are handled in a systematic way. Garbage collection or the de-allocation of unneeded objects avoids memory management errors in Java. Exception handling in Java avoids any mishandling of runtime errors.
- Java is secure- Java is very secure as it does not allow any system resources to be utilized. A so called virtual firewall protects the computer from any actions of the application and thus everything is confined within the JRE, preventing any unauthorized access. Also, the bytecode keeps the original code irretrievable and thus, the code remains safe.
- It is distributed- No longer do you have to remain confined within one system. With Java, you can now create distributed programs or applications with the help of Remote Method Invocation (RMI) or Java Beans. Using an internet connection, an individual can easily connect two systems and run a procedure compiled in one JVM on another JVM remotely.
- It supports multi-threading- Java enables you to perform many tasks at the same time with the help of its multi-threading feature.
- Java is Portable- As you can use the bytecode compiled by one JVM and OS on another JVM with a different OS, the Java language becomes platform independent as well as code portable.