title: Creating a method returning a boolean taking an object as argument
body: <p>Can anyone help me. i want to compare if two cars are faster by a method <code>isFaster(Car otherCar)</code>. Can someone help me understand how the <code>Car</code> object is compared with the <code>otherCar</code> object which is an argument on the <code>isFaster</code> method. How can I go about creating the body of the method.</p>
  
  <pre><code>public class Car {
    private String make ="";
    private int year = 0;
    private int maxSpeed = 0;
  
    public Car(String make,int year,int maxSpeed){
      this.make = make;
      this.maxSpeed = maxSpeed;
      this.year = year;
    }
  
    public void setSpeed(int maxSpeed){
      this.maxSpeed = maxSpeed;
    }
  
    public void setMake(String make){
      this.make = make;
    }
  
    public void setYear(int year){
      this.year = year;
    }
  
    public int getMaxSpeed(){
      return maxSpeed;
    }
  
    public int getYear(){
      return year;
    }
  
    public String getMake(){
      return make;
    }
  
    public String toString(double param){
      String temp = String.valueOf(param);
      return temp;
    }
  
    public String toString(int param){
      String temp = String.valueOf(param);
      return temp;
    }
  
    public String toString(char param){
      String temp = String.valueOf(param);
      return temp;
    }
  }
  </code></pre>