42). How to format date from one form to another?

[A]SimpleDateFormat
[B]DateFormat
[C]SimpleFormat
[D]DateConverter

Show Answer

43). How to convert Date object to String?

[A]SimpleDateFormat sdf = new SimpleDateFormat("yyyy-mm-dd"); sdf.parse(new Date());
[B]SimpleDateFormat sdf = new SimpleDateFormat("yyyy-mm-dd"); sdf.format(new Date());
[C]SimpleDateFormat sdf = new SimpleDateFormat("yyyy-mm-dd"); new Date().parse();
[D]SimpleDateFormat sdf = new SimpleDateFormat("yyyy-mm-dd"); new Date().format();

Show Answer

44). How to convert a String to a Date object?

[A]SimpleDateFormat sdf = new SimpleDateFormat("yyyy-mm-dd"); sdf.parse(new Date());
[B]SimpleDateFormat sdf = new SimpleDateFormat("yyyy-mm-dd"); sdf.format(new Date());
[C]SimpleDateFormat sdf = new SimpleDateFormat("yyyy-mm-dd"); new Date().parse();
[D]SimpleDateFormat sdf = new SimpleDateFormat("yyyy-mm-dd"); new Date().format();

Show Answer

46). How to identify if a timezone is eligible for DayLight Saving?

[A] useDaylightTime() of Time class
[B]useDaylightTime() of Date class
[C] useDaylightTime() of TimeZone class
[D]useDaylightTime() of DateTime class

Show Answer

47). What is the replacement of joda time library in java 8?

[A] java.time (JSR-310)
[B] java.date (JSR-310)
[C]java.joda
[D]java.jodaTime

Show Answer

50). How to get difference between two dates?

[A]long diffInMilli = java.time.Duration.between(dateTime1, dateTime2).toMillis();
[B] long diffInMilli = java.time.difference(dateTime1, dateTime2).toMillis();
[C]Date diffInMilli = java.time.Duration.between(dateTime1, dateTime2).toMillis();
[D]Time diffInMilli = java.time.Duration.between(dateTime1, dateTime2).toMillis();

Show Answer