Which of the classes will have more memory allocated?
No Answer is Posted For this Question
Be the First to Post Answer
Is hashset ordered java?
Is it possible to make an array volatile?
What is return null in java?
How to synchonise HashMap
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 are synchronized methods ?
What are multiple inheritances?
In a program, initializing an array of 100 KB is throwing an out of memory exception while there is 100 MB of memory available. Why?
Can we override protected method in java?
Should a main method be compulsorily declared in all java classes?
How do you use wildcards?
What is the purpose of tostring() method in java?