next up previous
Next: Car sales: public interface Up: Unit 09 Previous: Exercise: car sales

Car sales: representation of the objects

We determine the instance variables to use for representing objects of the classes Car and CarList.

The class Car

public class Car {
  // representation of the objects of the class
  private String model;
  private int year;
  private int km;
  private double price;

  // public methods that realize the requested functionalities
}

The class CarList

public class CarList {
  // representation of the objects of the class
  private String filename;

  // public methods that realize the requested functionalities
}


next up previous
Next: Car sales: public interface Up: Unit 09 Previous: Exercise: car sales