Assume a thread has lock on it, calling sleep() method on that thread will release the lock?
No Answer is Posted For this Question
Be the First to Post Answer
Where can I find data structures question and answers with comprehensive working code written in Java
How to sort an unsorted array in java?
Why are generics used?
How do you start a thread?
What are keywords in programming?
Explain where variables are created in memory?
Explain what is encapsulation?
Functionality of JVM?
Name the class that used to read objects directly from a stream?
public class Garbage { int a=0; public void add() { int c=10+20; System.out.println(c); System.out.println(a); } public static void main(String args[]) { Garbage obj=new Garbage(); System.gc(); System.out.println("Garbage Collected"); obj.add(); } } Above is a code in java used for garbage collection. object obj has been created for the class Garbage and system.gc method is called. Then using that object add method is called.System.gc method if called the obj should be garbage collected?
Can we increase size of array?
What is a boolean in java?