In previous article we learned how to Write your first Java program.
A Java class file is a file that contains Java bytecode and having .class extension. A Java class file is created by a Java compiler from .java files after successful compilation. If a .java file (source file) has more than one class then each class will compile into separate class files.
Let us take an example, save the following code as HelloWorld.java
public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello, World!");
}
}
Compile the above command with javac command
After successful compilation a new file is created HelloWorld.class.
When you open this file you will see byte code.
So, with the help of byte code Java is able to achieve platform independence.
To download Java click here.