What is "JAVA".
- Java is an Object-Oriented Programming language that produces software the multiple platform. When a programmer writes a java application, the compiled code (known as Byte code) runs on most operating system (OS), including Windows, Linux and Mac OS.
- Write Code once and it on almost any computing platform and OS.(Windows , Linux , MAC etc.)
- Java Code is used to developing Android App , many enterprise application, used for big data analytics, many computing application.
Architecture of JAVA :-
- Once developers write a java code which is basically called as source code needs to compile the Source code.
- Java compiler which basically stays in JDK (Java development Kit) compiles the Source code and converting .classfile which is called as byte code.
- Later byte code will be converted into machine code by the JVM. (Java Virtual machine).
JAVA Architecture Diagram :-
Java Architecture Diagram
Java Components :-
Main Components of JAVA are
- JDK
- JVM
- JRE
JDK (Java Development Kit)
- JDK contains tools required to write Java program and JRE to execute them.
- JDK includes java compiler to compile the java Source code.
Main object of JVM is to execute the byte code and converts to native machine code.
JVM performs following functions :
- Load the code
- Verifies the code
- Executes the code
- Provides Runtime Environments.
JRE(Java Runtime Environments)
- The JRE software builds a runtime environments in which java program can be executed .
- The JRE is the on-disk system that takes your java code, combines it with needed libraries, and starts the JVM to execute it. The JRE contains libraries and software needed by your java program to run.
- JRE is a part of JDK but can be download separately .
Why JAVA Platform Independent :
When is any programming language called as platform-independent? Well,
if and only if it run on all available operating system with respect to its development and compilation.
- In java because of bytecode which is executable by JVM which is platform dependent makes JAVA platform independent .
- Bytecode is code of the JVM which is machine-understandable.
Example:-
Hello.java
👉javac(Hello.class)
👉 JVM (Hello.obj)
👉final Output.