What is the use of default method in interface in java?
No Answer is Posted For this Question
Be the First to Post Answer
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 is difference between length and length() method in java ?
Can you sort a list in java?
Why are generics used?
Is array synchronized in java?
What is sortedmap in java?
How many bits is a double?
Define array. Tell me about 2-D array.
What is the default size of load factor in hashing based collection?
What is a local class in java?
What is the main advantage of passing argument by reference?
How does a for loop work java?