0% found this document useful (0 votes)
8 views2 pages

Core Java 1) Basics of Java 3) Internal Details of Java Program

The document provides an overview of Java program compilation and runtime processes, detailing the roles of the Java Compiler, Classloader, Bytecode Verifier, and Interpreter. It also addresses questions about saving Java source files under different names than the class name and the possibility of having multiple classes in a single Java source file. The content is specifically intended for students of Puneri Pattern Pvt. Ltd.

Uploaded by

godse.1001
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views2 pages

Core Java 1) Basics of Java 3) Internal Details of Java Program

The document provides an overview of Java program compilation and runtime processes, detailing the roles of the Java Compiler, Classloader, Bytecode Verifier, and Interpreter. It also addresses questions about saving Java source files under different names than the class name and the possibility of having multiple classes in a single Java source file. The content is specifically intended for students of Puneri Pattern Pvt. Ltd.

Uploaded by

godse.1001
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Puneri Pattern Pvt.

Ltd
Affordable & Live Training
Address: P2 304, Pentagon Tower 2, Magarpatta City IT Park, Hadapsar, Pune 28, India. Contact:
8766016640 Email: [email protected] Website: www.puneripattern.com

Internal Details of Java Program

What happens at compile time?

At compile time, the Java file is compiled by Java Compiler (It does not interact with OS) and converts the Java code into bytecode.

What happens at runtime?

At runtime, the following steps are performed:

Classloader: It is the subsystem of JVM that is used to load class files.

Bytecode Verifier: Checks the code fragments for illegal code that can violate access rights to objects.

Interpreter: Read bytecode stream then execute the instructions.

For Puneri Pattern Pvt. Ltd. Students Only.


Puneri Pattern Pvt.Ltd
Affordable & Live Training
Address: P2 304, Pentagon Tower 2, Magarpatta City IT Park, Hadapsar, Pune 28, India. Contact:
8766016640 Email: [email protected] Website: www.puneripattern.com

Q) Can you save a Java source file by another name than the class name?

Yes, if the class is not public. It is explained in the figure given below:

To compile: javac Hard.java


To execute: java Simple

Observe that, we have compiled the code with file name but running the program with class name. Therefore, we can save a Java
program other than class name.

Q) Can you have multiple classes in a java source file?

Yes, like the figure given below illustrates:

For Puneri Pattern Pvt. Ltd. Students Only.

You might also like