Given the code fragment:
SimpleDataFormat sdf;
Which code fragment displays the three-character month abbreviation?
A.
SimpleDateFormat sdf = new SimpleDateFormat (“mm”, Locale.UK); System.out.println
(“Result:” +
sdf.format(new Date()));
B.
SimpleDateFormat sdf = new SimpleDateFormat (“MM”, Locale.UK); System.out.println
(“Result:” +
sdf.format(new Date()));
C.
SimpleDateFormat sdf = new SimpleDateFormat (“MMM”, Locale.UK); System.out.println
(“Result:” +
sdf.format(new Date()));
D.
SimpleDateFormat sdf = new SimpleDateFormat (“MMMM”, Locale.UK); System.out.println
(“Result:” +
sdf.format(new Date()));
Explanation:
C
D
C