You are on page 1of 2

1. What are the states of a thread?

Answer: - 1. New 2. Runnable 3. Not Runnable 4. Dead


2. What are the different level lockings using the synchronization keyword?
Answer: Class level lock, Object level lock, Method level lock, Block level lock
3. What is a Marker Interface?
Answer:- An interface with no methods. Example: Serializable, Remote, Cloneable
4. What is differences between RESTful web services and SOAP web services ?
Though both RESTful web series and SOAP web service can operate cross platform they are
architecturally different to each other, here is some of differences between REST and SOAP:
1) REST is more simple and easy to use than SOAP
2) REST uses HTTP protocol for producing or consuming web services while SOAP uses XML.
3) REST is lightweight as compared to SOAP and preferred choice in mobile devices and PDA's.
4) REST supports different format like text, JSON and XML while SOAP only support XML.
5) REST web services call can be cached to improve performance.
5. What is difference between top-down and bottom-up approach of developing web services ?
In top-down approach first WSDL document is created and then Java classes are developed
based on WSDL contract. In case of bottom up approach of web service development you first
create Java code and then use annotations like @WebService to specify contract.
6. What are the implicit packages that need not get imported into a class file?
Answer: java.lang
7. Can a abstract method have the static qualifier?
Answer: No
8. Which HTTP methods are supported by RestFull web services ?
Answer: GET, POST, PUT, PATCH, DELETE
9. What does htpasswd do?
htpasswd is used to create and update the flat-files used to store usernames and password for
basic authentication of HTTP users. If htpasswd cannot access a file, such as not being able to
write to the output file or not being able to read the file in order to update it, it returns an error
status and makes no changes.
10. What interface do you implement to do the sorting?
Answer: Comparable
11. Whats the command to stop Apache?
Kill the specific process that httpd is running under, or killall httpd. If you have apachectl
installed, use apachectl stop.

12. On which port does Apache server work on?


http - port 80
https - port 443
13. How do you ensure a class is Serializable?
Answer: Implement Serializable
14. What Java classes are provided for date manipulation?
Answer: Calendar, Date
15. What are ORMs Spring supports ?
Spring supports the following ORMs :
Hibernate
iBatis
JPA (Java Persistence API)
TopLink
JDO (Java Data Objects)
OJB
16. What are the ways to access Hibernate using Spring?
Inversion of Control with a HibernateTemplate and CallbackExtending HibernateDaoSupport
and Applying an AOP Interceptor
17. What's the main difference between a Vector and an ArrayList?
Answer: Vector synchronized and ArrayList is not
18. For concatenation of strings, which method is good, StringBuffer or String ?
Answer: StringBuffer is faster than String for concatenation
Spring: http://www.careerride.com/Spring-Interview-Question.aspx
Hibernate: http://www.careerride.com/Hibernate-Interview-Questions.aspx
Webservices: http://www.careerride.com/Interview-Questions-Java-Web-services.aspx
Java: http://www.careerride.com/Java-Interview-Questions.aspx

You might also like