
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
Online Learning
Quiz
•
University
15 questions
ASSESSMENT IN LEARNING (BEED)
Quiz
•
University
10 questions
EdTech
Quiz
•
University
15 questions
PEOPLE MEDIA_SOCRATES
Quiz
•
7th Grade - University
10 questions
Simple Past.
Quiz
•
University
11 questions
TLE2 M5 PC Disassembly and Assembly
Quiz
•
University
10 questions
Cyber Security Awareness Quiz
Quiz
•
University
9 questions
Quiz de repaso de la UD3
Quiz
•
University
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
10 questions
Probability Practice
Quiz
•
4th Grade
15 questions
Probability on Number LIne
Quiz
•
4th Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
fractions
Quiz
•
3rd Grade
6 questions
Appropriate Chromebook Usage
Lesson
•
7th Grade
10 questions
Greek Bases tele and phon
Quiz
•
6th - 8th Grade
Discover more resources for Instructional Technology
12 questions
IREAD Week 4 - Review
Quiz
•
3rd Grade - University
20 questions
Endocrine System
Quiz
•
University
7 questions
Renewable and Nonrenewable Resources
Interactive video
•
4th Grade - University
30 questions
W25: PSYCH 250 - Exam 2 Practice
Quiz
•
University
5 questions
Inherited and Acquired Traits of Animals
Interactive video
•
4th Grade - University
20 questions
Implicit vs. Explicit
Quiz
•
6th Grade - University
7 questions
Comparing Fractions
Interactive video
•
1st Grade - University
38 questions
Unit 8 Review - Absolutism & Revolution
Quiz
•
10th Grade - University