What are the advantages of java over C++?
No Answer is Posted For this Question
Be the First to Post Answer
What is regex used for?
How variables are stored in memory?
Is set ordered?
Explain the difference between comparator and comparable in java?
How do you format in java?
Will the compiler creates a default constructor if I have a parameterized constructor in the class?
Why there are some null interface in JAVA? What does it mean? Give some null interface in JAVA?
Does java support Operator Overloading?
Distinguish method overloading and method overriding
What happens if we override only equals?
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 string example?