Download 164 Java Interview Questions by Nageswara Rao _ JAVAbyNATARAJ PDF

Title164 Java Interview Questions by Nageswara Rao _ JAVAbyNATARAJ
File Size1.4 MB
Total Pages18
Document Text Contents
Page 2

11/19/2014 164 Java Interview Questions by Nageswara Rao | JAVAbyNATARAJ 2/20

3) Which part of JVM will allocate the memory for a java program?
Ans). Class loader subsystem of JVM will allocate the necessary memory needed by the java

4). which algorithm is used by garbage collector to remove the unused
variables or objects from memory?

Ans). Garbage collector uses many algorithms but the most commonly used algorithm is mark and

5). How can you call the garbage collector?

Ans). Garbage collector is automatically invoked when the program is being run. It can be also
called by calling gc() method of Runtime class or System class in Java.

6) What is JIT Compiler?

Ans). JIT compiler is the part of JVM which increases the speed of execution of a Java program.

7) What is an API document?

Ans). An API document is a .html file that contains description of all the features of a softwar, a
product, or a technology. API document is helpful for the user to understand how to use the
software or technology.

8) What is the difference between #include and import statement?

Ans). #include directive makes the compiler go to the C/C++ standard library and copy the code
from the header files into the program. As a result, the program size increases, thus wasting
memory and processor’s time.

import statement makes the JVM go to the Java standard library, execute the code there , and
substitute the result into the program. Here, no code is copied and hence no waste of memory or
processor’s time. so import is an efficient mechanism than #include.

9) What is the difference between print( ) and println( ) method ?

Ans). Both methods are used to display the results on the monitor. print( ) method displays the
result and then retains the cursor in the same line, next to the end of the result. println( ) displays
the result and then throws the cursor to the next line.

10) What happens if String args[] is not written in main( ) method ?

Ans). When main( ) method is written without String args[] as:

Public static void main( )

The code will compile but JVM cannot run the code because it cannot recognize the main( ) as the
method from where it should start execution of the Java program. Remember JVM always looks
for main( ) method with string type array as parameter.

11) What is the difference between float and double?

Ans). Float can represent up to 7 digits accurately after decimal point, where as double can
represent up to 15 digits accurately after decimal point.

12) What is a Unicode system ?

Ans). Unicode system is an encoding standard that provides a unique number for every character,
no matter what the platform, program, or language is. Unicode uses 2 bytes to represent a single

Join this site
with Google Friend Connect

Members (795) More »

Already a member? Sign in


OCJP and Core Java class notes by

RamiReddy sir

DurgaSoft SCJP Notes Part-I


Web Services notes by Mr Sekhar

from Naresh i Tecnologies

Advaced Java Notes by Mr.Nataraj

from Ameerpeta

164 Java Interview Questions by

Nageswara Rao

DurgaSoft OCJP(SCJP) Notes Part-II


Spring notes by Mr.Nataraz from

Sathya Technologies

Struts Flow and Architecture

Web Services Notes by Nataraj sir

from Sathya Technologies

Hibernate notes by Sekhar sir from

Naresh i Technologies

► Java On
► Java Notes
► Of Java

► Java Notes
► Of Java
► Java New

Java - Synchronized block and method in detail..

Click Here

Page 9

Page 10

Page 18

Similer Documents