When you write any java class, the file extension must be .java . Take a simple java class to print Hello World:
public class Simple {
public static void main(String[] args) {
System.out.println("Hello World !!");
}
}
So save this file as Simple.java .
Now open cmd, say the file saved in the d: \ test directory
d: \ test> javac Simple.java // When you run this, .java is converted to byte code and stored in a file .class.
d: \ test> java Simple // The JVM will execute the bytecode file, i.e. Simple.class
Note: this whole process is done using the internal IDE
source
share