Exam 1z0-819 All QuestionsBrowse all questions from this exam
Question 195

Given the code fragment:

What is the result?

    Correct Answer: D

    The code provided creates a date object for December 17, 2018, and then formats it using two different styles: MEDIUM and SHORT. For MEDIUM style, the date will be formatted as 'Dec 17, 2018' in the 'en', 'US' locale. For SHORT style, the date will be formatted as '12/17/18'. Therefore, the correct output will be 'Dec 17, 2018' followed by '12/17/18'.

Discussion
ASPushkinOption: D

answer: D

d7bb0b2Option: D

D is correct: CAUSE-> FormatStyle.SHORT: This style produces the shortest format for the date and time. For example, for the date it might be '1/2/20' and for the time it might be '12 PM'. FormatStyle.MEDIUM: This style produces a longer format for the date and time. For example, for the date it might be 'Jan 2, 2020' and for the time it might be '12:00:00 PM'. FormatStyle.LONG: This style produces an even longer format for the date and time. For example, for the date it might be 'January 2, 2020' and for the time it might be '12:00:00 PM PST'. FormatStyle.FULL: This style produces the longest format for the date and time. For example, for the date it might be 'Thursday, January 2, 2020' and for the time it might be '12:00:00 PM Pacific Standard Time'

d7bb0b2Option: D

Tested D