Java

Java Programming

JAVA was developed by Sun Microsystems Inc in 1991, and after it was acquired by Oracle Corporation which was developed by James Gosling and Patrick Naughton.  The core benefit of JAVA programming is  Writing, compiling and debugging a program is easy in Java.  It helps to create reusable code. Sun systems have released the first public implementation which is named as Java 1.0 in the year 1995. It follows the WORA process which means “Write Once, Run Anywhere, which provides no-cost run-times on popular platforms.

Java terminology

Let’s take a look on common JAVA terminology which is commonly used in JAVA.

Java Virtual Machine (JVM)
The term Java Virtual Machine is generally referred to as JVM. Let’s see the phases of program execution. Phases are as follows: write the program, compile the program and at last run the program.

  • Writing of the program is done by java programmer.
    2 javac compiler is used for compilation of the program, javac is the primary java compiler included in java development kit (JDK). It takes input as a java program and generates output as Java bytecode.
    3) At last, JVM executes the bytecode generated by the compiler. This is called program run phase.

Bytecode

As mentioned above, javac compiler compiles the java source code i.e. java program into bytecode so that it can be executed by JVM. The compiler will save bytecode in a .class file.

Java Development Kit(JDK)

As the name implies, JDK stands for Java development kit which includes JRE (Java Runtime Environment), compilers and other tools like Java debugger, JavaDoc.

To create, compile and run Java program you need JDK installed on your computer.

Java Runtime Environment(JRE)

When we have JRE installed on our computer, we can run a java program but note that we won’t be able to compile it. JRE includes Java Virtual Machine (JVM), plugins and applets support. If we want to run a java program on our computer, we would only need  JRE.

Main Features of JAVA

Platform independent language

Java Compiler(javac) converts the source code (.java file) to the Java bytecode(.class file). JVM will execute the bytecode which is produced by the compiler. This bytecode can run on any platform such as Windows, Linux, Mac OS etc. Which means a program that is compiled on windows can run on Linux and vice-versa. Each operating system has different JVM, however, the output they produce after execution of bytecode is same across all operating systems. That is why we call java as platform independent language.

Object Oriented language

Object-oriented programming is a way of organizing programs as a collection of objects, each of which represents an instance of a class.

4 main concepts of Object Oriented programming are:

Abstraction

Encapsulation

Inheritance

Polymorphism

Simple

Java is considered as one of simple language because it does not have complex features like Operator overloading, Multiple inheritances, pointers, and Explicit memory allocation.

Robust Language

Robust means reliable. Java programming language is developed in a way that puts a lot of emphasis on early checking for possible errors, that’s why java compiler is able to detect errors that are not easy to detect in other programming languages. The main features of java that make it robust are garbage collection, Exception Handling, and memory allocation.

Secure

We don’t have pointers and we cannot access out of bound arrays (you get ArrayIndexOutOfBoundsException if you try to do so) in java. That’s why several security flaws like stack corruption or buffer overflow are impossible to exploit in Java.

Distributed

Using java programming language we can create distributed applications. RMI(Remote Method Invocation) and EJB(Enterprise Java Beans) are used for creating distributed applications in Java. In simple words: The java programs can be distributed on more than one systems that are connected to each other using internet connection. Objects on one JVM (java virtual machine) can execute procedures on a remote JVM.

Multithreading

Java supports multithreading. Multithreading is a Java feature that allows concurrent execution of two or more parts of a program for maximum utilization of CPU.

Portable

As discussed above, java code that is written on one machine can run on another machine. The platform-independent bytecode can be carried to any platform for execution that makes java code portable.

Leave a Reply

Your email address will not be published. Required fields are marked *

clear formPost comment