The correct answer is the letter B. For the simple fact that an exception cannot occur because even without placing the seconds, as it is an int, it assigns the value of 0 by default in the "dt" variable instantiation line. Lines 2 and 3 are useless because Date is immutable so to receive the value of the methods it would need to be assigned to a variable, so the 2 operations were lost. In line 4 printed the date in ISO format which is the answer of the letter B.
upvoted 1 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.
DriftKing
4 months, 1 week agoiSnover
1 year, 3 months ago