Frequently used terms

JDK(Java Development Kit)

JDK is a platform development environment.. It is used for developing Java applets and other applications. It contains a Java Runtime Environment(JRE), a interpreter/loader which loads the program into the memory and prepare it for execution, a compiler used to compile java programs and convert source code to binary code, an archiver used to combine all classes and metadata (data that gives information about other data) and convert into a .jar file, a documentation generator(javadoc produces a set of HTML pages which describes the type of classes, fields and methods in your program).



JRE(Java Runtime Environment)

It contains a set of software tools required to develop Java Applications. It contains JVM, some platform core classes and libraries. Just as a library is used to store book, java library stores some predefined classes that java applications can call at run time.
Now a question might arise that since both JDK and JRE can be used to run Java applications then why do we need to use both of them?
The answer is that you can run programs if you have JRE. However to develop an application and run it you need to have JDK.



JVM(Java Virtual Machine)

It is an abstract machine. It does not have any physical existence. The purpose of JVM is to load the code, Compile the code, execute the code and provide run time environment.
The above diagram shows the internal architecture of JVM.
  1. Classloader loads the class files.
  2. Class Area stores the fields and method data, code for methods.
  3. Heap is a runtime data area where objects are collected.
  4. Java stack holds local variables and partial results.
  5. Program Counter register holds the address of the instruction to be executed.
  6. Native method stack used to store native methods.
  7. Execution engine contains three parts:-
    1. A virtual processor.
    2. Interpreter.
    3. Just in time compiler which compiles a part of code that have similar functionality at the same time, and hence reduces the amount of time needed for compilation.
A frequently asked question is that Java is a platform independent while JVM is platform dependent. Why?

The answer is that Since every program needs to compiled and interpreted, Java does the same. After compiling a .class file is generated which is called a byte code. This byte code can run on other platforms as well and does not need to be recompiled. Thus Java is platform independent. JVM is platform dependent because JVM converts this byte code to the native machine code which is different for different machines.


API(Application Programming Interface)

Java application programming interface (API) is a list of all classes that are part of the Java development kit (JDK). It includes all Java packages, classes, and interfaces, along with their methods, fields, and constructors. These pre written classes provide a tremendous amount of functionality to a programmer. A programmer should be aware of these classes and should know how to use them.
In order to use a class from Java API, one needs to include an import statement at the start of the program. For example, in order to use the Scanner class, which allows a program to accept input from the keyboard, one must include the following import statement:
                                         import java.util.Scanner;


J2SE(Java 2 Standard Edition)

It is also known as Core Java. It is the most basic version of Java. It consists of a wide variety of general purpose API's and special purpose APIs. It is used to create applications on desktop environment. It consists of all the basics of the Java language like variables, data types, arrays, Streams, and much more.


J2ME(Java 2 Micro Edition)

This version of Java is mainly concentrated on embedded systems like mobiles. There are limitations that this version faces like low processing and battery power. J2ME uses many classes and APIs of J2SE and also APIs of its own. Most of the apps developed for older phones like Nokia were used to developed on this platform.


J2EE(Java 2 Enterprise Edition)

This version has much larger usage of Java like developing web services, networking and other web based applications. This is a community driven edition that means it always gets updated by industry experts. It also uses many features of J2SE and features of its own like Servlets, Java Beans, Java Messaging services. More people are attracted to this version because it is more web friendly.



Comments

Popular Posts