Write a program that creates Pet objects from data read from the keyboard. Store these objects into

Question:

Write a program that creates Pet objects from data read from the keyboard. Store these objects into an instance of ArrayList. Then sort the Pet objects into alphabetic order by pet name, and finally display the data in the sorted Pet objects on the screen. The class Pet is given in Chapter 6, Listing 6.1.

Listing 6.1

/** Class for basic pet data: name, age, and weight. */ public class Pet { private String name; private int age; private double weight;//in pounds //in years public Pet () { Default constructor name

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

Step by Step Answer:

Question Posted: