Google News
logo
Rest API - Interview Questions
Define RESTful Root Resource Classes in the JAX-RS API?
A resource class is nothing but a Java class that uses JAX-RS provided annotations for implementing web resources.

They are the POJOs that are annotated either with @Path or have at least one method annotated with @Path, @GET, @POST, @DELETE, @PUT, etc.

Example :
import javax.ws.rs.Path;
/**
* InterviewBitService is a root resource class that is exposed at 'resource_service' path
*/
@Path('resource_service')
public class InterviewBitService {
   // Defined methods
}
Advertisement