adplus-dvertising
frame-decoration

Question

What is the output of this program?

Note : The program is executed at 3 hour 55 minutes and 4 sec (24 hours time).
    import java.text.*;
    import java.util.*;
    class Date_formatting
    {  
        public static void main(String args[])
        {
     Date date = new Date();
     SimpleDateFormat sdf;
            sdf = new SimpleDateFormat("mm:hh:ss");
            System.out.print(sdf.format(date));
        } 
    }

a.

3:55:4

b.

3.55.4

c.

55:03:04

d.

03:55:04

Posted under Java Programming

Answer: (c).55:03:04

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. What is the output of this program? Note : The program is executed at 3 hour 55 minutes and 4 sec (24 hours time).

Similar Questions

Discover Related MCQs

Q. Which of the following is not a class of java.util.regex?

Q. What is the significance of Matcher class for regular expression in java?

Q. Object of which class is used to compile regular expression?

Q. Which capturing group can represent the entire expression?

Q. groupCount reports a total number of Capturing groups.

Q. Which of the following matches nonword character using regular expression in java?

Q. Which of the following matches end of the string using regular expression in java?

Q. What does public int end(int group) return?

Q. What does public String replaceAll(string replace) do?

Q. What does public int start() return?

Q. Which of the following is not introduced with Java 8?

Q. What is the purpose of BooleanSupplier function interface?

Q. What is the return type of lambda expression?

Q. Which is the new method introduced in java 8 to iterate over a collection?

Q. What are the two types of Streams offered by java 8?

Q. Which method is used to create a directory with fileattributes?

Q. Which method can be used to check fileAccessiblity?

Q. How can we delete all files in a directory?

Q. How to copy the file from one location to other?

Q. How can we get the size of specified file?