What is Java

Java is an object-oriented language. The source code of java files (files with a .Java extension) are compiled into a bytecode (files with a .class extension), which can then be executed by a Java interpreter.The syntax of Java is largely influenced by C++. Java is platform independent, that means once the source code is compiled into bytecode then this bytecode will execute on any machine. It's robust and secure. Java was developed by
Sun Microsystems and released in 1995.


Hello World program in Java :

public class MyFirstProgram {

   public static void main(String []args) {
      System.out.println("Hello World");
   }
}

After execute this program there are two file will create , one is "MyFirstProgram.java" and another one is "MyFirstProgram.class". Here
"MyFirstProgram.java" is the file of source code and "MyFirstProgram.class" is the bytecode file . This  file(.class extension) will execute on any machine , does not need to re-compile it before execute on machine .That's why java is called platform independent language . 



Find us :
        Facebook : @apnaandroid
        Google+   : Apna Java
        YouTube : Android & Java Tutorial

Comments

Popular posts from this blog

Disable/Hide Year from DatePickerDialog in android

Custom Calendar in android

Constructor in Java