Consider the following program:
import java.util.*; class Main {//from w w w. j ava 2s . c om public static void main(String []args) { Formatter formatter = new Formatter(); Calendar calendar = Calendar.getInstance(Locale.US); calendar.set(/* year =*/ 2012, /* month = */ Calendar.FEBRUARY, /* date = */ 1); formatter.format("%tY/%tm/%td", calendar, calendar, calendar); System.out.println(formatter); } }
Which one of the following options is correct?
c)
The format specifier %t allows for formatting date and time information.
It takes as suffix the format and part of the date or time information.
The format Y is for the year displayed in four digits.
The format m is for month as decimal (with months in the range 01 to 12).
The format d is for the day of month as decimal (with the days in the range 01 - 31).