Solved

Suppose You Wish to Implement the Comparable Interface to Allow

Question 49

Multiple Choice

Suppose you wish to implement the Comparable interface to allow your Vehicle class to compare Auto objects only.Which of the following is the correct way to do this?


A) public class Auto implements Comparable<Vehicle>
B) public class Vehicle implements Comparable(Auto)
C) public class Vehicle implements Comparable
D) public class Vehicle implements Comparable<Auto>

Correct Answer:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions