What are exception handling keywords in java?
No Answer is Posted For this Question
Be the First to Post Answer
explain autoboxing in java?
What is foreach loop in java?
What are passing parameters?
What is an example of declaration?
What is default switch case? Give example.
Program to Find the second largest element in an array.
What advantage do java's layout managers provide over traditional windowing systems?
Can we create constructor in abstract class ?
Is java an open source?
What is the order of arraylist in java?
Why stringbuilder is not thread safe in java?
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?