Professional Documents
Culture Documents
Which of the following package will help to the below program that compiles
without error?
/*Insert Line*/
public class Execute
{
public static void main(String[] args)
{
Date d = new Date();
}
}
Question 1
A) import java.util.Date;
B) import java.lang.Date;
C) import java.text.Date;
D) import java.io.Date
Question 2
Assume that the date is 01/23/2014, time is 9H 54M 36S, ISTzone and the day
is Thursday. Then what could be the output of the following program?
import java.util.*;
public class TestSkill
{
public static void main(String args[])
{
Date dNow = new Date();
System.out.println("Current Date: " + (dNow));
}
}
Question 2
A) Current Date: Jan 23 2014
B) 11:58:59
B) 1:39:1
C) 1:39:0
B) Month May
B) Sunday
B) 2013-8-15-1-3-258-10-21-69-55-
C) 2013-8-15-1-3-3-10-22-9-55
B) 7-1-1-1-2-2-3-3-4-4-4-
C) 7~1~1~1~1~1~1~1~2~2~2~
B) 2013-Sep-15-22-09-55-
C) 2013-9-15-10-9-55-
A) $date->modify(‘+2 months’);
D) $date->modify(‘2+ months’);
Question 16
How to convert Date object to String?
B) -2
C) -3