How to do encapsulation in java?
No Answer is Posted For this Question
Be the First to Post Answer
What is string pooling concept?
What’s the difference between the methods sleep() and wait()?
What is loop in java?
What is object-oriented programming?
What are the differences between wait() and sleep()?
What is java util function?
What does the append?
What an i/o filter?
what is mean by overriding in which situation we wil use?
5 Answers Atlas Systems, CSC, DCPL,
What is the main use of generics in java?
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 command line arguments?