Why Java is platform Independent language #Row coder

 java quiz link
Why Java is platform Independent language

We know that Java is platform independent language but how

1. First of all we have to know that what is platform independent ?

Answer: When you can run your code on other behaviour computer System like Window, Linex, IOS.

  Or

write once Run anywhere is called Platform Independent.

Who :

Lets take one example:

Class Hello{

  public static void main(String[] agrs){

  System.out.println(“hi manvik”);}

}

Now,

  Compiler : Javac Hello.java

When you run program it will compile first.

Javac compile code and convert it in to Hello. Class

Now that .class file is a Byte code and you can run that .class file on any computer system.

With the help of Byte code Java is a platform independent language.

Java has both compiler and interpreter.

After compiler compile code and generated .class file(Byte code) then interpreter interpret that Byte code and run it

 (JVM gives environment).






Comments