Is ++ operator thread-safe in java?
No Answer is Posted For this Question
Be the First to Post Answer
What is a compilation unit?
Explain about core java?
What does regex mean?
What are the types of loops in Java, and how are they used?
What is the reflection?
What is access modifiers?
What is instance example?
what is the difference b/w PUT and POST method to send data to the server
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?
When do we use synchronized blocks and advantages of using synchronized blocks?
What is Mutex (Mutual Exclusion Object) ?
What is identifier in java?