Drop Down MenusCSS Drop Down MenuPure CSS Dropdown Menu

Java Interview Question 1

Q.1. What is difference between JDK, JVM and JRE?

Ans:- JDK-  is stand on Java Development Kit. It physically exists. It contains JRE + development tools.

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

JVM - is stand on Java Virtual Machine, it is an abstract machine which provides the runtime environment in which java bytecode can be executed. it  available for many hardware and software platforms so JVM is platform dependent.

Q.2. Define the memory areas allocated to JVM. 
Class(Method) Area
Program Counter Register
Native Method Stack

Q.3. What is Platform?
Ans:- A platform is basically the hardware or software environment in which a program/software runs. Basically there are two types of platforms hardware-based and software-based, But Java provides the software-based platform.

Q.4. What is JIT Compiler?
Ans:- JIT 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(According to Hardware and Software specifications of Machine).

Q.5. What is Classloader?
Ans:- Classloader is a subsystem of JVM that is used to load the classes and interfaces.There are many types of classloaders e.g. Bootstrap classloader, Extension classloader, System classloader, Plugin classloader etc.

Q.6. Is next,delete,exit,main or null are keyword in java?
Ans:- No

Q.7. What happened if we write "static public void" instead of "public static void"?
Ans:- This code is ok and program is compiled and execute properly. 

Q.8.  What is the default value of local variable?
Ans:- There is no default value is initialized in default variable, neither primitives or object references.

Q.9 Why Java is called 'write once and run anywhere' nature? 
Ans:- The bytecode give it this power. 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 depended/specific and so can be run it on any platform.

Q.10 What is the main difference between Java platform and other platforms?
Ans:- The Java platform differs from most other platforms in the sense that it's a software-based platform instead of hardware-based platform so it is runs on top of other hardware-based platforms. There are mainly to  components in Java Platform:

1. Runtime Environment
2. API(Application Programming Interface)

No comments:

Post a Comment