Sample answer: "@RestController is @Controller plus @ResponseBody. With @Controller, a returned String is a view name. With @ResponseBody, the return value is written to the body by an HttpMessageConverter, for example Jackson to JSON."
What the docs say:
@RestControlleris "a convenience annotation that is itself annotated with @Controller and @ResponseBody."- Every method "inherits the type-level @ResponseBody annotation and, therefore, writes directly to the response body versus view resolution."
- The return value is "serialized to the response body through an HttpMessageConverter", and a class-level
@ResponseBodyis inherited by all methods.