By Ramakrishna on Dec 17, 2008 in Define static keyword | 0 Comments
static is a keyword and means ‘ can be accessed without the help of an object ‘.
static is used an access modifier with members ( variables and methods ) of class. A static member belongs to the whole class. That is, all the objects of the class share ( or access ) the same [...]
By Ramakrishna on Jul 7, 2008 in Basic Java Interview Questions | 0 Comments
JAVA GARBAGE COLLECTION INTERVIEW QUESTIONS AND ANSWERS
Q) Explain Garbage collection in Java?
A) In Java, Garbage Collection is automatic. Garbage Collector Thread runs as a low priority daemon thread freeing memory.
Q) When does the Garbage Collection happen?
A) When there is not enough memory. Or when the daemon GC thread gets a chance to run.
Q) When [...]
By Ramakrishna on Jul 1, 2008 in Basic Java Interview Questions | 0 Comments
Multi-threaded design questions
Q) Do I need to use synchronized on setValue(int)?
A) It depends whether the method affects method local variables, class static or instance variables. If only method local variables are changed, the value is said to be confined by the method and is not prone to threading issues.
Q) Do I need to use [...]
By Ramakrishna on Jul 1, 2008 in Basic Java Interview Questions | 0 Comments
THREADS INTERVIEW QUESTIONS AND ANSWERS JAVA
Q) What is threaded programming and when is it used?
A) Threaded programming is normally used when a program is required to do more than one task at the same time. Threading is often used in applications with graphical user interfaces; a new thread may be created to do some processor-intensive [...]