Sunday, August 1, 2010

Interview with THOUGHTFOCUS

1. If we need to you collection for two different purpose. One is for easy search and other for frequent insertion/deletion, which collection class should be used?
A - ArrayList for later and LinkedList for former.

2. Difference between List and Set?
A - Set does not allows duplicate and List allows.

3. What are singleton class and its features?

4. What are Hashtable and Map?

5. Difference between String, StringBuffer and StringBuilder?
A - Strings are immutable and StringBuffer are mutable. StringBuffer is designed to be thread-safe and all public methods in StringBuffer are synchronized. StringBuilder does not handle thread-safety issue and none of its methods is synchronized.

6. Two classes as given below -
public class A{
public String id;
public String name;

//getter/setter
}
public class B extends A{
public String id;
public String name;

//getter/setter
}

creating a new instance of B using reference for A and calling name getter on it, which name getter will be called? A or B?
A - A

7. Life cycle of servlet?

8. How JSP bean tags work?

9. How custom tags are written?

10. Struts validator framework?

11. What if some validation fails in struts and I want to forward the application to some error page. Where should I configure that?

No comments:

Post a Comment