B4 - The Comparable Interface

B4 - The Comparable Interface

University

10 Qs

quiz-placeholder

Similar activities

SWBAT identify fallacies of logic in advertisements

SWBAT identify fallacies of logic in advertisements

3rd Grade - University

10 Qs

positive thoughts

positive thoughts

7th Grade - Professional Development

10 Qs

Intro to DDP2

Intro to DDP2

University

10 Qs

Correlation Analysis

Correlation Analysis

University

10 Qs

Categorical and Quantitative Data Quiz

Categorical and Quantitative Data Quiz

University

10 Qs

Measurement

Measurement

University

7 Qs

CASAS Practice

CASAS Practice

10th Grade - University

11 Qs

Units 5 & 6

Units 5 & 6

University

10 Qs

B4 - The Comparable Interface

B4 - The Comparable Interface

Assessment

Quiz

Other

University

Medium

Created by

Ahmetcan türk

Used 6+ times

FREE Resource

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

An interface, in general, is a list of what things?

methods and variables

classes and constants

methods

methods and constants

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Say that you are writing a class Book and wish it to implement the Comparable<Book> interface. What method must Book contain?

int compareTo( Book other )

int compareTo( Object other )

Book compareTo( Object other )

boolean compareTo( T other )

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the value of "zebra".compareTo("emu")

a negative integer

0

a positive integer

unpredictable

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the value of (new Integer(5)).compareTo( new Integer(8) )

a negative integer

0

a positive integer

unpredictable

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

If the objects of a class are arranged into their natural order, then if object L is left of object R what is true?

L.compareTo(R) is positive

L.compareTo(R) is negative

L.compareTo(R) is zero

R.compareTo(L) is negative

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

If X.compareTo(Y) is positive, then which of the following is true?

Y.compareTo(X) is positive

Y.compareTo(X) is negative

Y.compareTo(X) is zero

Y.compareTo(X) is unknown

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

If X.equals(Y) is true, then which of the following is true for most classes that implement Comparable?

X.compareTo(Y) is negative

X.compareTo(Y) is zero

X.compareTo(Y) is positive

Nothing can be said.

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?