home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 November / CMCD1104.ISO / Software / Freeware / Programare / bluej / bluejsetup-200.exe / {app} / examples / debugdemo / Car.java < prev    next >
Encoding:
Java Source  |  2004-09-15  |  632 b   |  34 lines

  1. /**
  2.  * Class Car - nonsense class for debugger demo
  3.  * 
  4.  * @author Michael Kolling
  5.  * @version 13 August 1999
  6.  */
  7. public class Car
  8. {
  9.     private int numberOfFrontSeats;
  10.     private int numberOfBackSeats;
  11.  
  12.     /**
  13.      * Create a car with seat numbers
  14.      */
  15.     public Car(int frontSeats, int backSeats)
  16.     {
  17.         numberOfFrontSeats = frontSeats;
  18.         numberOfBackSeats = backSeats;
  19.     }
  20.  
  21.     /**
  22.      * Return the number of seats in the car.
  23.      */
  24.     public int seats()
  25.     {
  26.         int totalSeats;
  27.  
  28.         totalSeats = numberOfFrontSeats;
  29.         totalSeats += numberOfBackSeats;
  30.  
  31.         return totalSeats;
  32.     }
  33. }
  34.