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 8423If all the methods in abstract class are declared as abstract then what is difference between abstract class and in interface?
8 15219How to validate the request (Eg:user name and password) in session(http session)? not in LDAP server ?
1 5988In C we use only compiler. Why java uses both compiler and interpreter? What is its significance?
5 18336wHAT IS DEFAULT SPECIFIER IN JAVA wHAT IS DEFAULT CONSTRUCTOR IN JAVA wHAT IS DEFAULT METHOD IN JAVA
IBM,
12 19836Write 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 9945
What is an image buffer?
Who is founder of java?
Are generics important java?
How many types of gc are there in java?
Can we override protected method in java?
What is jagged array in java?
Is string a class in java?
What is local variable and instance variable?
What is the difference between member variables initialization and assignment in a constructor?
Does string is thread-safe in java?
Explain about instanceof operator in java?
When is the finally clause of a try-catch-finally statement executed?
What is the epoch date?
What is a control variable example?
What is the console in java?