Java Notes 14
Java Notes 14
Java Notes 14
A Java source code file takes the name of a public class or interface that is
defined within the file. A source code file may contain at most one public
class or interface. If a public class or interface is defined within a source code
file, then the source code file must take the name of the public class or
interface. If no public class or interface is defined within a source code file,
then the file must take on a name that is different than its classes and
interfaces. Source code files use the .java extension.
The JVM is the software that executes Java bytecode. A Java program,
written in a file with a .java extension, is c ompiled into class files that have
a .class extension. The class files are written in bytecode. To execute these
files, the computer uses the JVM to interpret the bytecode. A browser that is
capable of executing Java applets has the JVM built into it. To run a Java
application, the Java Runtime Environment (JRE) must be installed. The
bytecode is the same for all platforms, but the JVM will be different on
different platforms because it needs to execute programs using the native
code of the machine it is running on.