
B4 - The Comparable Interface

Quiz
•
Other
•
University
•
Medium

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
Similar Resources on Wayground
10 questions
Coding Challenge Round 1

Quiz
•
University
10 questions
Integers Quiz

Quiz
•
University
10 questions
Operating system revision quiz1(semaphores)

Quiz
•
University
14 questions
T Test

Quiz
•
University
10 questions
text structure and text organazation

Quiz
•
6th Grade - Professio...
13 questions
ICS - Bellwork -9/8/25 - 9/12/25

Quiz
•
3rd Grade - University
13 questions
Introduction to Python Programming Quiz 9E

Quiz
•
10th Grade - University
10 questions
Pemrograman Dasar

Quiz
•
University
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
20 questions
Brand Labels

Quiz
•
5th - 12th Grade
15 questions
Core 4 of Customer Service - Student Edition

Quiz
•
6th - 8th Grade
15 questions
What is Bullying?- Bullying Lesson Series 6-12

Lesson
•
11th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
Discover more resources for Other
20 questions
Definite and Indefinite Articles in Spanish (Avancemos)

Quiz
•
8th Grade - University
7 questions
Force and Motion

Interactive video
•
4th Grade - University
36 questions
Unit 5 Key Terms

Quiz
•
11th Grade - University
7 questions
Figurative Language: Idioms, Similes, and Metaphors

Interactive video
•
4th Grade - University
15 questions
Properties of Equality

Quiz
•
8th Grade - University
38 questions
WH - Unit 3 Exam Review*

Quiz
•
10th Grade - University
21 questions
Advise vs. Advice

Quiz
•
6th Grade - University
12 questions
Reading a ruler!

Quiz
•
9th Grade - University