troubleshooting Question

Using Comparable Interface

Avatar of Slck_P
Slck_P asked on
JavaWeb Servers
1 Comment1 Solution347 ViewsLast Modified:
I'm having trouble writing code that will take in an object and compare the objects based on a return from my getScore method.  Any help is appreciated.  Any additional information can be given on request also.

     public class ShortStirrupRider implements Rider1, Comparable <Rider1>
       public ShortStirrupRider(String nameofRider, String typeofPony,double heightofFence,double overallScore)
         Rider = nameofRider;
         Pony = typeofPony;
         Fence = heightofFence;
         Score = overallScore;
       public int compareTo(Object Rider1)
       public String toString(){
         String output = "Name: " + nameofRider + "\n" +
            "Type of Pony: " + typeofPony +"%\n" +
            "Fence Height:" + heightofFence + "\n" +
            "Overall Score: " + overallScore + "\n";
         return output;
public class Rider1 implements ShortStirrupRider, LongStirrupRider
       public int setScore();
       public int getScore();
       public int setHeight();
         double height;
         private static final int inch = 4;
         private static final int hand = 1;
         double equineHeight;
       public String getHeight();

Open in new window

Mick Barry
Java Developer

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Top Expert 2010

The Distinguished Expert awards are presented to the top veteran and rookie experts to earn the most points in the top 50 topics.

Join our community to see this answer!
Unlock 1 Answer and 1 Comment.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 1 Comment.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros