Sei sulla pagina 1di 3

ASSIGNMENT #01

Q No :1What is JDK,JRE and JVM and what are the differences between them
?You may also use any figure/diagram to further elaborate your answer.

JDK
 The Java Development Kit (JDK) is a software development environment used
for developing Java applications and applets.
 JDK includes the Java Runtime Environment (JRE), an interpreter/loader
(Java), a compiler (javac), Javadoc and other tools needed in Java development.
 JDK and JRE(Java Runtime Environment) both contains JVM so that we can
run our java program.

JRE
 JRE stands for “Java Runtime Environment” and may also be written as “Java
RTE.”
 The Java Runtime Environment provides the minimum requirements for
executing a Java application; it consists of the Java Virtual Machine (JVM), core
classes, and supporting files.
 JDK(Java Development Kit) is for development purpose whereas JRE is for
running the java programs.

JVM
 JVM (Java Virtual Machine) is an abstract machine. It is called a
virtual machine because it doesn't physically exist.
 A specification where working of Java Virtual Machine is specified. But
implementation provider is independent to choose the algorithm.
 Runtime Instance Whenever you write java command on the command prompt
to run the java class, an instance of JVM is created.
 JVM(Java Virtual Machine) is the heart of java programming language and
provides platform independence.

Difference between JDK, JRE and JVM

JDK = JRE + Development Tool


JRE = JVM + Library Classes

JDK

Q No:2 What do we mean by the terms Portability and Platform


Independence? How is Java platform independent?
Ans: Portability is defined as the moving instructions in one language
from one operating environment to another operating environment.
 It allows to develop programs irrespective of hardware.
 For example, C, C++, Java are portable language whereas source
code, bytecode, machine code of Java is non-portable.
While Platform independence is the ability of a software to run on various
platforms, usually achieved by the use of running the code over virtual
machines in case of java it is JVM.
 If the application's compile code can run in any other operating
system then that application is called platform-independent.
 It is required in distributed application.
How is Java Platform Independent
Platform independent language means once compiled you can execute the
program on any platform (OS).
Because the Java compiler converts the source code to bytecode, which is
Intermediate Language. Bytecode can be executed on any platform (OS)
using JVM (Java Virtual Machine).

Potrebbero piacerti anche