Be careful here, to me this question is one of very tricky question. Answer is B and not A because A forces data type conversion from string to Integer/long.
The correct option is B. Add @PathVariable long accountId argument to the update() handler method.
The @PathVariable annotation is used to bind a path variable from the request URI to a parameter in the handler method. In this case, the path variable is id, and the type is long. This means that the account id will be passed to the update() handler method as a long value
The answer is A. B will only be valid if the parameter name matches the path variable in the the URL.
upvoted 4 times
...
...
Log in to ExamTopics
Sign in:
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
Azuni
Highly Voted 1 year, 3 months ago2211094
Most Recent 4 months, 3 weeks agoIYONISSIO
1 year, 3 months agoAzuni
1 year, 3 months ago