What is the best way to findout the time/memory consuming process?
No Answer is Posted For this Question
Be the First to Post Answer
Where and how can you use a private constructor?
what is the use of bean managed and container managed with example?
Can you run java program without main method?
Where is the singleton class used?
Can we increase size of array?
Explain Basics of OOP Language in java
How to know the host from which Applet is originated?
Can one thread block the other thread?
Where import statement is used in a java program?
What does jenkins do?
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?
which pattern is default in scanner package?