Java is a computer programming language. Mr. James Gosling designed Java in the year 1991 and he was from Sun Microsystems Company. Firstly, Java was named as Green Talk after that it was changed to Oak and finally changed to java. The first java version was launch in the year 1995 i.e. java version 1.0. Oracle Corporation was acquired by Sun Microsystem in the year 2010. latest java version is Java SE 11, Can be download and install java from the official site Java download
What is Java Programming?
Java follows the Oops concept (object-oriented programming language). In Java, everything is an Object except the primitive java type. Programs written in Java are platform independent. It means java programs can run on any of the operating systems in spite of JDK (java developer kit) must be available on that particular machine.
Java follows automatic memory management, its automatically allocates memory to newly created object and automatically realized the memory when the object is not in use or object is destroyed.
Java is a case-sensitive programming language so we have to take care of its case format.
The syntax of Java is similar to the c language
Comparing Java and C language:
In C language:-
When we are writing any c program that must be saved with the dot c extension. After compiling that c program, it generates a .exe file or native code. This native code is platform dependent which means it cannot be used on some other platform because when native code or .exe file is being generated then it has added some compatible issue related to Windows operating system which cannot be used on some other platform so c language is platform dependent.
In Java language:-
When we are writing any Java-based program that must be saved with the dot java extension. After successfully compiling that java program it generates. Class file or byte-code. Run the program that byte code will get converted to native code, that native code will internally communicate with windows operating system. There is no physical extension of native code in java. As bytecode is platform-independent we can use this byte-code on any other platform, only JDK (java developer kit) must be available on that machine.
Terms used in Java:
- Source code: The code, which is being written by the developer, is called source code. For writing source code we can use any of the IDE for example- Net Beans, IntelliJ IDEA, Eclipse etc.
- Byte code: After successful compilation of the source code, it will get Byte code, which is independent to the platform
- Native code: It is also called a machine code and it is in the machine standard format, which is specific to a machine or the platform.
- Compiler: It is a program with the name of java.exe. It is mainly responsible for two things
- Checking the syntax of the language.
- If there is no mistake then generate the .class file.
- JVM: JVM stands for java virtual machine, which provides the platform-independent execution environment.
- JDK: JDK stands for the Java development kit. It comes in different version according to the SUN or Oracle release.
These are the following Java version: –
- JDK 1.2 (Playground)
- JDK 1.4 (Marline)
- JDK 1.5 (Tiger)
- JDK 1.6 (Mustang)
- JDK 1.7 (Dolphin)
- JDK 1.8 (Spider)
- JDK 1.9 (Jigsaw)
JDK provides different tools and library in order to compile and run or in order to develop the java application. It is platform dependent which will be different for the different platforms
- JRE: Java run time environment provide the entire library and all other resources in order to run the java program.
- INTERPRETATION: It is also a program with a name of java.exe, which is responsible to convert byte code to native code line to line. It is a time taking process so in order to solve the Problem with the interpreter.
- JIT COMPILER: Stands for ‘JUST IN TIME’ compiler, which reads bytecode at a time and converts to the native code at a time. It is the faster process in compare to the Interpreter. Internally, this uses the V-Table concept to store the information about byte code and native code. Under that V-Table it maintains two information, one for bytecode and a second one is for the native code.
State whether following is either True or false!
- Java program is platform-independent?
- Ans: True
- C program is platform-independent?
- Ans: False
- C program is platform dependent?
- Ans: True
- JDK is platform dependent?
- Ans: True
- Bytecode is platform-independent?
- Ans: True
- Native code or .exe is platform-independent?
- Ans: False
Please, feel free to drop a comment in the comment box, if you find any doubt regarding the topic or you want to share any information about the topic. Happy Java Learning!
READ NOW :- Java Programming