Thursday 31 December 2015

7 Difference between REST and SOAP WebService in Java Interview

Difference between REST and SOAP in Java
What is the difference between REST and SOAP Web-service is a very popular question from Java J2EE interviews. I have myself asked this question a number of times. Here I am listing out some of the key differences between REST and SOAP purely from interview perspective i.e. I am only mentioning key points, not going into details. Unless you are doing exclusive work in REST or SOAP Web service, interviewer will not go into deep and if you have done the work already, you probably don't need this list. Anyway, let's see some key difference between REST and SOAP web service in Java.

6 Difference between wait() and sleep() method in Java

Though both wait() and sleep() method are used to pause the running thread, here are some important difference between them:

1) The wait() method must be called from the synchronized context (can be a synchronized block or method) but sleep() method can be called from within our with-out synchronized block.