Which class cannot be a subclass in java?
No Answer is Posted For this Question
Be the First to Post Answer
What do you understand by weak reference?
does java support default argument in Method?
what are the rules to use try catch finally?
Why are generics used?
How hashmap works in java?
What is difference between fileinputstream and filereader in java?
Difference between Map & Hashmap
What is the new line character?
Can we declare the main method of our class as private?
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?
What super () does in java?
whst is encapsulation?when u encpsulate actually while devoloping code?