Top 20 Java Basic Interview Questions

1.What is the most Important feature of java?
Java is platform independent language.

2.What do you mean by Platform Independence?
Platform Independence you can run and compile program in one platform and can execute in any other platform.

3.What is JVM(Java Virtual Machine)?
JVM is Java Virtual Machine which is a run time Environment for the compiled java class.

4.What is JIT Compiler?
Just-In-Time(JIT) compiler is used to improve the performance. JIT compiles parts of the byte code that have similar functionality at the same time,

5.Are JVM’s Platform Independent?
JVM’S are not platform Independent. JVM’S are platform Specific.

6.What if main method declare as private?
No,It will compile fine but in run time it will error like main method should be in public.cannot find main method.

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

8.What all memory areas are allocated by JVM?
Heap, Stack, Program Counter Register and Native Method Stack

9.What is the base class of all classes?
java.lang.Object

10.What is javac ?
It produces the java byte code from *.java file.
It is the intermediate representation of your source code that contains instructions.

   

Comments are closed