LinuxHelps.com

A blog for Linux Lovers.

Posted by sibu on October 1, 2014

Diff between .java vs .class

.java file is Java source code, in a plain text that programmers edit.

java compiler converts your java code into byte-code (.class)

Example: javac filename.java

a new file filename.class is created by the Java compiler. This is a file containing Java bytecode, which is essentially a file that the Java interpreter can read. That’s what makes Java multi-platform. You can transport this .class file from Windows to Linux and run:

java filename

you will be getting the same result.

Comments are closed.