Search Header Logo

Utility classes

Authored by Rolland Gavriliță

Computers

Professional Development

Used 2+ times

Utility classes
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

8 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Which of the following is true about the java.lang.Object class?

It is the superclass of all classes in Java

It can only be used with primitive types

It cannot be extended by any other class

It provides no useful methods

2.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Which method is used to obtain the current date with the LocalDate class?

LocalDate.getCurrent()

LocalDate.ofNow()

LocalDate.currentDate()

3.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What does the LocalDateTime class represent?

A timestamp in milliseconds.

A date with time zone information.

A date and time without any time zone.

Only a time value.

4.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What is a key difference between java.util.Date and java.sql.Date?

java.util.Date represents only the date, while java.sql.Date includes time.

java.sql.Date is designed for SQL databases and typically ignores the time part, whereas java.util.Date includes both date and time.

java.util.Date is immutable, while java.sql.Date is mutable.

They are functionally identical.

5.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Which class is typically used to represent a precise point in time (including date and time with nanosecond precision) for SQL databases?

Date
Datetime
Time
Timestamp

6.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Which method of the Random class is used to generate a random integer?

nextLong()
nextDouble()
nextFloat()
nextInt()

7.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

In which package is the Scanner class, used for reading input from the user, located?

java.util
java.text
java.io
java.lang

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?