← Quiz: Spring Boot Interview Questions: all 10 questions
Quiz: Spring Boot Interview Questions · Question 2 of 10
Which is a correct description of @RestController?
Which is a correct description of @RestController?
- A.It is the same as @Service
- B.@Controller + @ResponseBody, so return values are written as JSON
- C.It creates a database repository
- D.It only handles GET requests
Answer & explanation
Correct answer: @Controller + @ResponseBody, so return values are written as JSON
Every handler method's result becomes the response body.
Can you get the rest right without peeking?
Take the timed Quiz: Spring Boot Interview Questions quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →