Java Reference
In-Depth Information
2-2. Write a class that represents a person's mailing address. It should have sepa-
rate fields for the name, street address, city, state, and ZIP code. Define a
toString()
method that produces nicely formatted output.
2-3. Using the
Sort.Comparer
and/or the
Sort.Comparable
interfaces, write a static
search()
method for a class named
Search
that performs an efficient binary
search for a specified object within a sorted array of objects. If the object is
found in the array,
search()
should return the array index at which it is
located. Otherwise, it should return -1.