0% found this document useful (0 votes)
53 views4 pages

Internal Details of Java

The document discusses the internal details of compiling and running a "Hello Java" program. It explains that at compile time, the Java compiler converts Java code into bytecode. At runtime, the classloader loads class files, the bytecode verifier checks for illegal code, and the interpreter executes the bytecode instructions. It also answers two questions - that a Java source file can be saved with a different name than the class if it is not public, and that a source file can contain multiple classes.

Uploaded by

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

Internal Details of Java

The document discusses the internal details of compiling and running a "Hello Java" program. It explains that at compile time, the Java compiler converts Java code into bytecode. At runtime, the classloader loads class files, the bytecode verifier checks for illegal code, and the interpreter executes the bytecode instructions. It also answers two questions - that a Java source file can be saved with a different name than the class if it is not public, and that a source file can contain multiple classes.

Uploaded by

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

Internal Details of Hello Java

Program
1. Internal Details of Hello Java

In the previous page, we have learned about the first program, how to compile and how
to run the first java program. Here, we are going to learn, what happens while compiling
and running the java program. Moreover, we will see some question based on the first
program.

What happens at compile time?

At compile time, 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, following steps are performed:


Classloader: 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
right to objects.
Interpreter: read bytecode stream then execute the instructions.

Q)Can you save a java source file by other 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

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

Yes, like the figure given below illustrates:

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy