first commit
This commit is contained in:
33
Semester 1/Programming 1/Java/examples/debugdemo/Car.java
Normal file
33
Semester 1/Programming 1/Java/examples/debugdemo/Car.java
Normal file
@@ -0,0 +1,33 @@
|
||||
/**
|
||||
* Class Car - nonsense class for debugger demo
|
||||
*
|
||||
* @author Michael Kolling
|
||||
* @version 13 August 1999
|
||||
*/
|
||||
public class Car
|
||||
{
|
||||
private int numberOfFrontSeats;
|
||||
private int numberOfBackSeats;
|
||||
|
||||
/**
|
||||
* Create a car with seat numbers
|
||||
*/
|
||||
public Car(int frontSeats, int backSeats)
|
||||
{
|
||||
numberOfFrontSeats = frontSeats;
|
||||
numberOfBackSeats = backSeats;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the number of seats in the car.
|
||||
*/
|
||||
public int seats()
|
||||
{
|
||||
int totalSeats;
|
||||
|
||||
totalSeats = numberOfFrontSeats;
|
||||
totalSeats += numberOfBackSeats;
|
||||
|
||||
return totalSeats;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user