Menu
Question Index
...

Assume that the date is 01/23/2014, time is 10H 56M 02S, IST zone and the day is Thursday. Then what could be the output of the following program?

import java.util.*;
public class DateDemo {
    public static void main(String args[]) {
        try {
            System.out.println(new Date());
            Thread.sleep(5 * 60 * 10);
            System.out.println(new Date());
        } catch (Exception e) {
            System.out.println("Got an exception!");
        }
    }
}


Thu Jan 23 10:56:02 IST 2014
Thu Jan 23 10:56:05 IST 2014
Thu Jan 23 10:56:02 IST 2014
Thu Jan 23 11:46:02 IST 2014
Thu Jan 23 10:56:02 IST 2014
Thu Jan 23 11:01:02 IST 2014
Some other output
Compilation Error or Runtime Error

Doubts

Problems

Topic: Java Date Class

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App