
Ans.Reclaiming the unused memory by the invalid objects. Garbage collector is responsible for this process
2.What kind of thread is the Garbage collector thread?
Ans. It is a daemon thread.
3.What is a daemon thread?
Ans.These are the threads which can run without user intervention. The JVM can exit when there are daemon thread by killing them abruptly.
4.How will you invoke any external process in Java?
Ans. Runtime.getRuntime().exec(â?¦.)
5.What is the basic difference between string and stringbuffer object?
Ans. String is an immutable object. StringBuffer is a mutable object.
6.

//java program for static member method
public class staticc{
int i;
static int j;
public static void staticMethod(){
System.out.println("you can access a static method this way");
}
public void nonStaticMethod(){
i=100;
j=1000;
System.out.println("Don't try to access a non static method");
}
public static void main(String[] args) { //i=100;
j=1000; //nonStaticMethod(); staticMethod();
} }

String objects are constants and immutable where as StringBuffer objects are not.StringBuffer Class supports growable and modifiable string where as String class supports constant strings. Strings once created we cant modify them. Any such attempt will lead to the creation of new strings.Where as StingBuffer objects after creation also can be able to delete oo append any characteres to it.String values are resolved at run time where as StringBuffer valuesc are resolved at compile time.So if you know the exact size of the string to be appended it is better to go for String objects.

Nice Collections of Java Interview question. It really helpful for beginner as well as developer. Check following link too, It is also having a nice collection on Java interview question...
http://mindstick.com/Interviewer/QuestionPage.aspx?topicid=10&topic=Java
Thanks everyone for your nice collection.
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.