What Will Be The Output Of The Following Java Programp Pre #974
What will be the output of the following Java program?</p> <pre><code class="language-java" line="1"> 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)); } }</code></pre> <p>Note : The program is executed at 3 hour 55 minutes and 4 sec (24 hours time).
This multiple choice question (MCQ) is related to the book/course
gs gs128 Java.
It can also be found in
gs gs128 java-regular-expressions - Java Text Formatting - Quiz No.1.
What will be the output of the following Java program?
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)); } }
Note : The program is executed at 3 hour 55 minutes and 4 sec (24 hours time).
3:55:4
3.55.4
55:03:04
03:55:04