⭐Explaination
As a engineerwe will write the java program in notepad or edit plus it is also called as source code,which is in human readable format.
Once after writing a program we have to save it with an extension .java in below path.
c:/programfiles/java/jdk1.8/bin,or anywhere.
Once after saving we need to convert human readable format into machine readable format to perform that we gor cmd(command prompt).
In Command Prompt we perform two Operations.
1)javac(java Compiler)
2)java(java Interpreter)
.java File will be given as an input for the Compiler where it will check for
1.Syntax.
2.Rules.
3.Translates .java file to .class file.
.class file is a intermediate code which cannot be understood neither by humans nor by machine which is in byte code format.
.class file will be given as input for Interpreter were it will
1.Read Line-By-Line.
2.Excutes(JVM).
3.Translates from .class file to binary file.
The binary file will be given to O.S and it will give user the OUTPUT in human readable language.
If we Violet any Syntax or Rules we will get Compile-Time Error(CTE).
If we find any Abnormal Condition's like 1/0 then we get Runtime Error called Arthemetic Exeception.
JIT(Just-In-Time):-
It is whole responsible to Translate .class file to .binary format.
JVM(Java Virtual Machine):-
It's a virtual machine doesn't Exist's Physically and it is whole responsible for executing the JAVA Program's.
JRE (Java Runtime Environment:-
It's a environmental setup provided to Run The JAVA Program.
JDK (Java Development Kit):-
It's a kit which consists of all the Library Files and Utilities to develop a java software.
Question:-
Is Java Platform Independent? why.
Ans:-Yes, JAVA is platform independent. The .class file can be executed on any electronic device hence Java is platform independent.