Home » JAVA Programming » Date & Time » Question
  1. What is the output of this program?
    import java.text.*;
    import java.util.*;
    public class DateFormatting_Example
    {
    public static void main(String args[])
    {
    Date d = new Date();
    SimpleDateFormat sdf;
    sdf = new SimpleDateFormat("mm:hh:ss");
    System.out.print(sdf.format(d));
    }
    }
    1. 24:08
    2. 24:08:18
    3. 24
    4. Compilation error
    5. Runtime error
Correct Option: B

24:08:18



Your comments will be displayed only after manual approval.