0% found this document useful (0 votes)
33 views

) What Is Difference Between JDK, JRE and JVM?: More Details..

The document discusses key Java concepts: JDK contains development tools plus the JRE, while the JRE implements the JVM specification and provides runtime environment. The JVM is an abstract machine that executes Java bytecode. The JVM allocates memory to the class area, heap, stack, program counter register, and native method stack. The JIT compiler improves performance by compiling bytecode sections with similar functionality together, reducing compilation time. It translates from the JVM instruction set to CPU instructions. Java provides a software-based platform that runs on hardware platforms. It has a runtime environment and APIs, giving Java its write-once-run-anywhere nature through platform-independent bytecode.

Uploaded by

prema
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
33 views

) What Is Difference Between JDK, JRE and JVM?: More Details..

The document discusses key Java concepts: JDK contains development tools plus the JRE, while the JRE implements the JVM specification and provides runtime environment. The JVM is an abstract machine that executes Java bytecode. The JVM allocates memory to the class area, heap, stack, program counter register, and native method stack. The JIT compiler improves performance by compiling bytecode sections with similar functionality together, reducing compilation time. It translates from the JVM instruction set to CPU instructions. Java provides a software-based platform that runs on hardware platforms. It has a runtime environment and APIs, giving Java its write-once-run-anywhere nature through platform-independent bytecode.

Uploaded by

prema
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

) What is difference between JDK,JRE and JVM?

JVM
JVM is an acronym for Java Virtual Machine, it is an abstract machine which provides the
runtime environment in which java bytecode can be executed. It is a specification.

JVMs are available for many hardware and software platforms (so JVM is platform
dependent).

JRE
JRE stands for Java Runtime Environment. It is the implementation of JVM.

JDK
JDK is an acronym for Java Development Kit. It physically exists. It contains JRE +
development tools.

more details...

2) How many types of memory areas are allocated by JVM?


Many types:

1. Class(Method) Area

2. Heap

3. Stack

4. Program Counter Register

5. Native Method Stack

more details...

3) What is JIT compiler?


Just-In-Time(JIT) compiler:It is used to improve the performance. JIT compiles parts
of the byte code that have similar functionality at the same time, and hence reduces the
amount of time needed for compilation.Here the term “compiler” refers to a translator
from the instruction set of a Java virtual machine (JVM) to the instruction set of a
specific CPU.

4) What is platform?
A platform is basically the hardware or software environment in which a program runs.
There are two types of platforms software-based and hardware-based. Java provides
software-based platform.

5) What is the main difference between Java platform and other


platforms?
The Java platform differs from most other platforms in the sense that it's a software-
based platform that runs on top of other hardware-based platforms.It has two
components:

1. Runtime Environment

2. API(Application Programming Interface)

6) What gives Java its 'write once and run anywhere' nature?
The bytecode. Java is compiled to be a byte code which is the intermediate language
between source code and machine code. This byte code is not platform specific and
hence can be fed to any platform.

7) What is classloader?
The classloader is a subsystem of JVM that is used to load classes and interfaces.There
are many types of classloaders e.g. Bootstrap classloader, Extension classloader, System
classloader, Plugin classloader etc.

8) Is Empty .java file name a valid source file name?


Yes, save your java file by .java only, compile it by javac .java and run by java
yourclassname Let's take a simple example:

1. //save by .java only


2. class A{
3. public static void main(String args[]){
4. System.out.println("Hello java");
5. }
6. }
7. //compile by javac .java
8. //run by java A
compile it by javac .java

run it by java A

You might also like