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?
6 8217If all the methods in abstract class are declared as abstract then what is difference between abstract class and in interface?
8 14937How to validate the request (Eg:user name and password) in session(http session)? not in LDAP server ?
1 5905In C we use only compiler. Why java uses both compiler and interpreter? What is its significance?
5 18143wHAT IS DEFAULT SPECIFIER IN JAVA wHAT IS DEFAULT CONSTRUCTOR IN JAVA wHAT IS DEFAULT METHOD IN JAVA
IBM,
12 19416Write java code to print "Hello how are you" Thread1 should have "Hello" Thread2 should have "how are you" both the threads should start at the same time
4 9769
What is keyset in java?
What is private static class in java?
What restrictions are placed on method overloading in java programming?
Can we use string in switch case in java?
What are the 7 types of characters?
Can an integer be null java?
What does substring mean?
List some important characteristics on jre
What is space character in java?
What is the java idl system?
What are the methods available in a class?
What is boolean used for?
What is the use of 'super' keyword inside a constructor?
What is java’s garbage collected heap?
Is java same as core java?