
Dates and Times
Quiz
•
Instructional Technology
•
University
•
Medium
Kevin Tinsley
Used 5+ times
FREE Resource
11 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
When compared with the new date/time API that was introduced with Java 8, what is an advantage of the old date/time API?
It’s thread-safe.
It’s intuitive.
It’s easier to localize for parts of the world that don’t use the Gregorian calendar.
It works with versions of Java prior to Java 8.
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What package stores the LocalDateTime class?
java.util
java.text
java.time
java.date
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is true about a LocalDate object?
It represents a date only.
It works from the observer’s perspective.
It represents a time only.
Both a and b.
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
If the current time is 5pm, what is printed to the console? LocalTime now = LocalTime.now(); LocalTime startTime = LocalTime.of(15, 30); if (now.compareTo(startTime) < 0) { System.out.println("early"); } else if (now.compareTo(startTime) > 0) { System.out.println("late"); } else if (now.compareTo(startTime) == 0) { System.out.println("on time"); }
early
late
on time
nothing
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following statements gets the month from a LocalDate object named now?
int month = now.getMonth();
int month = now.getMonthInt();
Month month = now.getMonth();
Month month = now.getMonthInt();
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Given a LocalDate object named date, which of the following statements changes the day of the month to the 12th?
LocalDate newDate = date.withDayOfMonth(12);
LocalDate newDate = date.setDayOfMonth(12);
LocalDate newDate = date.withDay(12);
LocalDate newDate = date.setDay(12);
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Given a LocalDateTime object named now that stores the current date and time, which of the following statements gets a new LocalDateTime object that’s four weeks in the future?
LocalDateTime newDateTime = now.incrementWeeks(4);
LocalDateTime newDateTime = now.addWeeks(4);
LocalDateTime newDateTime = now.plusWeeks(4);
LocalDateTime newDateTime = now.plus(WEEKS, 4);
Create a free account and access millions of resources
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?
Similar Resources on Wayground
10 questions
Non-Digital Instructional Materials
Quiz
•
University
13 questions
FUN 101 week 1
Quiz
•
University
12 questions
Time Telling
Quiz
•
University
10 questions
English Tenses
Quiz
•
University
15 questions
Genres of Literature
Quiz
•
8th Grade - University
13 questions
ES - Classificações de Rede de Comunicação
Quiz
•
University
15 questions
ADMINISTRASI SISTEM JARINGAN (XI TKJ)
Quiz
•
University
15 questions
ADMINISTRASI SISTEM JARINGAN (XII TKJ)
Quiz
•
University
Popular Resources on Wayground
10 questions
Ice Breaker Trivia: Food from Around the World
Quiz
•
3rd - 12th Grade
20 questions
MINERS Core Values Quiz
Quiz
•
8th Grade
10 questions
Boomer ⚡ Zoomer - Holiday Movies
Quiz
•
KG - University
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
Adding Integers
Quiz
•
6th Grade
20 questions
Multiplying and Dividing Integers
Quiz
•
7th Grade
10 questions
How to Email your Teacher
Quiz
•
Professional Development
15 questions
Order of Operations
Quiz
•
5th Grade
Discover more resources for Instructional Technology
10 questions
Boomer ⚡ Zoomer - Holiday Movies
Quiz
•
KG - University
7 questions
Central Idea of Informational Text
Interactive video
•
4th Grade - University
20 questions
Physical or Chemical Change/Phases
Quiz
•
8th Grade - University
7 questions
Force and Motion
Interactive video
•
4th Grade - University
39 questions
Unit 7 Key Terms
Quiz
•
11th Grade - University
7 questions
Transition Words and Phrases
Interactive video
•
4th Grade - University
18 questions
Plotting Points on the Coordinate Plane
Quiz
•
KG - University
5 questions
Declaration of Independence
Interactive video
•
4th Grade - University
