Suppose you have created a Student class compare To() method that is based on the value of

Question:

Suppose you have created a Student class compare To() method that is based on the value of a private idNum field. Assume the class contains a public getId () method that returns the idNum value. Also suppose that stu1’s idNum is 345 and that stu2’s idNum is 456. Which of the following returns 1?
a. Stu1.compareTo(stu2)
b. Stu2.compareTo(stu1)
c. Stu2.compareTo(stu1.idNum)
d. Stu1.getId().compare To (stu2.getId())

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  answer-question

Java Programming

ISBN: 9780357673423

10th Edition

Authors: Joyce Farrell

Question Posted: