O'Reilly logo

Programmer's Guide to Java™ Certification, A: A Comprehensive Primer, Second Edition by Rolf W. Rasmussen, Khalid A. Mughal

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Programming Exercises

10.1 Create a class named Pair, which aggregates two arbitrary objects. Implement the equals() and hashCode() methods in such a way that a Pair object is identical to another Pair object if, and only if, the pair of constituent objects are identical. Make the toString() implementation return the textual representation of both the constituent objects in a Pair object. Objects of the Pair class should be immutable.
10.2 A palindrome is a text phrase that spells the same thing backward and forward. The word redivider is a palindrome, since the word would spell the same even if the character sequence were reversed. Write a program ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required