Showing posts with label CORE JAVA INTERVIEW QUESTION (170 questions). Show all posts
Showing posts with label CORE JAVA INTERVIEW QUESTION (170 questions). Show all posts

Friday, January 31, 2014

CORE JAVA INTERVIEW QUESTION (170 questions)

148)What are wrapper classes?

Wrapper classes are classes that allow primitive types to be accessed as objects.

149)What is a native method?

A native method is a method that is implemented in a language other than Java.

150)What is the purpose of the System class?

The purpose of the System class is to provide access to system resources.

151)What comes to mind when someone mentions a shallow copy in Java?

Object cloning.

CORE JAVA INTERVIEW QUESTION (170 questions)

117) What is Garbage Collection?

Garbage collection is a process of reclaiming the runtime unused objects.It is performed for memory management. more details...

118) What is gc()?

gc() is a daemon thread.gc() method is defined in System class that is used to send request to JVM to perform garbage collection.

119) What is the purpose of finalize() method?

finalize() method is invoked just before the object is garbage collected.It is used to perform cleanup processing.

120) Can an unrefrenced objects be refrenced again?

Yes.

121)What kind of thread is the Garbage collector thread?

Daemon thread.

122)What is difference between final, finally and finalize?

final: final is a keyword, final can be variable, method or class.You, can't change the value of final variable, can't override final method, can't inherit final class.
finally: finally block is used in exception handling. finally block is always executed.
finalize():finalize() method is used in garbage collection.finalize() method is invoked just before the object is garbage collected.The finalize() method can be used to perform any cleanup processing.