0% found this document useful (0 votes)
2 views3 pages

Java Execution Steps

The document explains the Java programming language, detailing its components such as source code, byte code, and the Java Runtime Environment (JRE). It describes how Java is platform-independent due to the Java Virtual Machine (JVM) converting byte code into machine code, and outlines the role of the Java Development Kit (JDK) and Integrated Development Environments (IDEs) in Java application development. Additionally, it introduces object-oriented programming concepts, emphasizing the relationship between classes and objects.

Uploaded by

rishirajd2011
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)
2 views3 pages

Java Execution Steps

The document explains the Java programming language, detailing its components such as source code, byte code, and the Java Runtime Environment (JRE). It describes how Java is platform-independent due to the Java Virtual Machine (JVM) converting byte code into machine code, and outlines the role of the Java Development Kit (JDK) and Integrated Development Environments (IDEs) in Java application development. Additionally, it introduces object-oriented programming concepts, emphasizing the relationship between classes and objects.

Uploaded by

rishirajd2011
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

JAVA SOURCE CODE

(.java file)

Compiler(javac)

JAVA BYTE CODE


(.class file)

Execution stage
JAVA RUNTIME ENVIRONMENT

BYTE CODE INTERPRETER (java)

VERIFIER JUST-IN-TIME COMPILER

MEMORY MANAGER
JAVA API
GARBAGE COLLECTOR

OS
WINDOWS/LINUX/MAC

Page | 1
JAVA TERMINOLOGY
1. Source code: instructions written in high level language format
following the guidelines of the programming language.
For Java the source code is stored in a file with extension .java
and the name of the file will be same as the class name.
2. Byte code: It is intermediate code known as Byte code is generated
by Java after compilation is done by the compiler of Java(name:
javac). The extension of the byte code file is .class and name of the
byte code file will be same as class name. This code which can only
be converted to machine code by Java`s software platform known as
JVM(JAVA VIRTUAL MACHINE). So JVM provides an
environment where byte code gets converted to machine code and
finally executed. So as Java Byte code is only available to be readable
by JVM and not by operating system so this makes Java a platform
independent language where one single byte code generated in any
computer by the java compiler can be executed by JVM available for
all operating systems. JVM acts as an intermediary between the
Java code and the underlying hardware and operating system,
converting bytecode into machine-specific code.
3. The Java Runtime Environment (JRE) is the runtime portion of
Java programming which includes JVM and is designed for users who
only need to execute Java programs.
4. JVM includes different components which includes
interpreter(name: java) which converts byte code to machine
readable format. Interpreter alongwith JIT(Just in time)
compiler speed up the execution process and also tracks runtime
errors. It also contains memory manager which controls storage of
data. It also contains Java API(Application Programming
Interface) is the library of Java containing packages.
A package in Java is a container which contains collection of
related compiled classes and sub-packages which can be used in
the program development.
So we can conclude that Java uses both compiler and interpreter.

Page | 2
5. JDK(Java Development Kit): The Java Development Kit (JDK) is
a software development environment used for creating and
running Java-based applications. It includes the Java Runtime
Environment (JRE) which includes JVM and Java API, along
with translators like a compiler, interpreter, that are essential for
developers to build, test, and deploy Java programs.
6. IDE(Integrated development environment): It is an application
software that provides an environment for developing Java-based
applications which includes writing the code, compiling the code
to generate byte code and finally execute the code. BlueJ IDE will
be used to run java programs.

As Java is an object-oriented programming language (OOP), so to


execute a task in Java we need to create an object. A real-world object
has a defined characteristics and associated behaviour. While a
software object has defined data members (values stored in a variable
of a particular datatype) and associated methods (subprograms which
acts as executable code). Methods divides a task into smaller tasks
where each of the method performs unique task. Methods helps us to
reuse the same logic to be used many times without writing the same
code again and again. So, to design a software object, a class is created.
So, in OOP a class is a blueprint of an object and object is an instance
of a class.
So, if Car is a class then Maruti, Toyota are objects.

Page | 3

You might also like