Question 108 of 130 from exam 1Z0-809: Java SE 8 Programmer II

Question 108 of 130 from exam 1Z0-809: Java SE 8 Programmer II

Question

Given the code fragment:

// Login time:2015-01-12721:58:18.8172
Instant loginTime = Instant.now()7
Thread. sleep (1000);

// Logout time:2015-01-12721:58:19.8802
Instant logoutTime = Instant.now();

loginTime = loginTime.truncatedTo(ChronoUnit MINUTES); // line n1
logoutTime = logoutTime.truncatedTo (ChronoUnit .MINUTES) ;

Af (logoutTime.isAfter (loginTime) )
System. out.printIn ("Logged out at:"+logoutTime) ;
else
System.out.printIn("Can't logout");

What is the result?

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D.

D.