
Dates and Times
Authored by Kevin Tinsley
Instructional Technology
University
Used 5+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
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);
Access all questions and much more by creating a free account
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
Already have an account?
Similar Resources on Wayground
10 questions
PHP BASIC
Quiz
•
University
10 questions
Network Topologies Quiz
Quiz
•
University
11 questions
piecemeal distribution of cash
Quiz
•
University
10 questions
DL Refresher
Quiz
•
KG - Professional Dev...
14 questions
electricidad y electrónica
Quiz
•
University
16 questions
Online Workshop Yakobus
Quiz
•
6th Grade - Professio...
15 questions
CYBER ADDA
Quiz
•
University
12 questions
Star Wars
Quiz
•
8th Grade - Professio...
Popular Resources on Wayground
7 questions
History of Valentine's Day
Interactive video
•
4th Grade
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
fractions
Quiz
•
3rd Grade
15 questions
Valentine's Day Trivia
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
Discover more resources for Instructional Technology
18 questions
Valentines Day Trivia
Quiz
•
3rd Grade - University
12 questions
IREAD Week 4 - Review
Quiz
•
3rd Grade - University
23 questions
Subject Verb Agreement
Quiz
•
9th Grade - University
5 questions
What is Presidents' Day?
Interactive video
•
10th Grade - University
7 questions
Renewable and Nonrenewable Resources
Interactive video
•
4th Grade - University
20 questions
Mardi Gras History
Quiz
•
6th Grade - University
10 questions
The Roaring 20's Crash Course US History
Interactive video
•
11th Grade - University
17 questions
Review9_TEACHER
Quiz
•
University