public class Car
{
/*c1*/ private String owner;
/*c2*/ private int year;
/*c3*/ private String co;
/*c4*/ private String model;
/*c5*/ public Car(String ownerIn,
int yearIn, String coIn, String modelIn)
/*c6*/ {
/*c8*/
this.owner = ownerIn;
/*c9*/
this.year = yearIn;
/*c10*/
this.co = coIn;
/*c11*/
this.model = modelIn;
/*c12*/ }
/*c13*/
/*c14*/ public
String getOwner()
/*c15*/ {
/*c16*/
return this.owner;
/*c17*/ }
/*c18*/ public
void updateOwner(String ownerIn)
/*c19*/ {
/*c20*/
this.owner = ownerIn;
/*c21*/ }
/*c22*/ public boolean
equals(Car other)
/*c23*/ {
/*c24*/
boolean equalIndicator =
/*c25*/
this.owner == other.owner && this.year == other.year
/*c26*/
&& this.co == other.co && this.model == other.model;
/*c27*/
if (equalIndicator)
/*c28*/
{
/*c29*/
System.out.println(this + " EQUALS " + other);
/*c30*/
}
/*c31*/
else
/*c32*/
{
/*c33*/
System.out.println(this + " DOES NOT EQUAL " + other);
/*c34*/
}
/*c35*/
return equalIndicator;
/*c36*/ }
/*c37*/ public Car
duplicateShopOwned()
/*c38*/ {
/*c39*/ Car
newCar = new Car("SHOP", this.year, this.co, this.model);
/*c40*/
return newCar;
/*c41*/ }
/*c42*/ public void printCar()
/*c43*/ {
/*c44*/
System.out.println("This car is owned by " + this.owner + " and is year
"
+ this.year + " and is made by " + this.co +
" and is a model " + this.model);
/*c45*/ }
/*c46*/ public String
toString()
/*c47*/ {
/*c48*/
return ("owner: " + this.owner + " and year: "
+ this.year + " and co: " + this.co +
" and model: " + this.model);
/*c49*/ }
}