Best writers. Best papers. Let professionals take care of your academic papers

Order a similar paper and get 15% discount on your first order with us
Use the following coupon "FIRST15"
ORDER NOW

First, create a class called Dog that implements the Comparable interface. Dog will contain a member variable to

First, create a class called Dog that implements the Comparable interface. Dog will contain a member variable to

hold a name, a constructor that sets up the name, and three methods (getName, compareTo, toString). getName returns the member variable, compareTo works as defined by the Comparable interface, and toString returns the name neatly formatted. Second, you’ll compare Dogs by their names. Include a main method in Dog that asks the user to input ten names and generates ten Dog objects. A blank name should not be used to create an object. Using the compareTo method, determine first and last dog among them and print them. Do not simply sort the Dog data. [17 points]

 
Looking for a Similar Assignment? Order now and Get 10% Discount! Use Coupon Code "Newclient"