Question

areTo method for FamousPerson objects cts Revisited, what is the output of the following code se crile oct on the FamousPerson objects defined in Section 5.4, g Based on the nclude phrases such as a negative integer? rs may include phras ew FamousPerson (Peter ,Parker,1962, Spiderman): W FamousPerson (Bonnie,Parker,1910, Criminal): ew FamousPerson (Clark . Kent,1938, Superman): f4 new FamousPerson(Clark , Kent, 1938, Reporter): sPerson - new fanousPerson f2 = 3n gamousPerson f3 3n0us out.printin(f1.compareTo (f1)) t.out.println (fl.compareTo (f2)); stem.out.printin (f2.compareTo (f1)): system.out.printin(fl.compareTo (E3)); ystem.out.println (f3.compareTo (f4)): ystem.out.println (f4.compareTo (f3)); Sys Sy
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Any issue post comment...

System.out.println(f1.compareTo(f1)); // True
System.out.println(f1.compareTo(f2));   // False
System.out.println(f2.compareTo(f1));   // False
System.out.println(f1.compareTo(f3));   // False
System.out.println(f3.compareTo(f4));   // False
System.out.println(f4.compareTo(f3));   // False

all the object files are different from one another..

f1 == f1. is only true.

Add a comment
Know the answer?
Add Answer to:
areTo method for FamousPerson objects cts Revisited," what is the output of the following code se...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT