I have a piece of code like this:
@RequestMapping(value = "/find/{id}")
@GetMapping
public ResponseEntity<QuestionModel> find(@PathVariable("id") Long id) {
Question question = questionService.find(id);
QuestionModel questionModel = new QuestionModel(question);
**return new ResponseEntity<>(questionModel, HttpStatus.OK);**
}
I wanna know that what's differences between that & this:
@RequestMapping(value = "/find/{id}")
@GetMapping
public ResponseEntity<QuestionModel> find(@PathVariable("id") Long id) {
Question question = questionService.find(id);
QuestionModel questionModel = new QuestionModel(question);
**return new ResponseEntity(questionModel, HttpStatus.OK);**
}