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 7994If all the methods in abstract class are declared as abstract then what is difference between abstract class and in interface?
8 14695How to validate the request (Eg:user name and password) in session(http session)? not in LDAP server ?
1 5822In C we use only compiler. Why java uses both compiler and interpreter? What is its significance?
5 17959wHAT IS DEFAULT SPECIFIER IN JAVA wHAT IS DEFAULT CONSTRUCTOR IN JAVA wHAT IS DEFAULT METHOD IN JAVA
IBM,
12 18970Write 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 9603
Can you inherit a constructor java?
Does sprintf allocate memory?
What about method local inner classes or local inner classes in java?
What is immutability in java?
How do you write a good declaration?
What is an example of procedure?
Is namespace same as package in java?
How many types of memory areas are allocated by jvm?
Is ++ operator is thread safe in java?
What is generic class?
What do you mean by constant time complexity?
What is the difference between final, finally and finalize()?
How is garbage collection controlled?
Why do we use variables?
How do you download stubs from Remote place?