Given the code format:
SimpleDateFormat sdf;
Which code statements will display the full text month name?
A.
sdf = new SimpleDateFormat (“mm”, Locale.UK);
System.out.println(“Result:”, sdf.format(new date()));
B.
sdf = new SimpleDateFormat (“MM”, Locale.UK);
System.out.println(“Result:”, sdf.format(new date()));
C.
sdf = new SimpleDateFormat (“MMM”, Locale.UK);
System.out.println(“Result:”, sdf.format(new date()));
D.
sdf = new SimpleDateFormat (“MMMM”, Locale.UK);
System.out.println(“Result:”, sdf.format(new date()));
Explanation:
Typical output would be
Current Month in M format: 2
Current Month in MM format: 02
Current Month in MMM format: Feb
Current Month in MMMM format: February
D
D
sdf = new SimpleDateFormat (“MMMM”, Locale.UK);
System.out.println(“Result:”+ sdf.format(new Date()));