Car - } public int getCapacity () { return capacity; }...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
public class Car { private int capacity; private int miles; private int year; private String make; private String model; public Car() { this.capacity = 0; this.miles = 0000; this.year= 0000; this.make = new String(); this.model = new String(); } public Car(int capacity, int miles, int year, String make, String model) { this.capacity = capacity; this.miles = miles; this.year= year; this.make = make; this.model= model; } public void setMile( int miles) { this.miles = miles; } public int getMiles () { return miles; } public void setCapacity( int capacity) { this.capacity = capacity;
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: } public int getCapacity () { return capacity; } public void setYear( int year) { this.year = year; } public int getYear () { return year; } public void setMake( String make) { this.make = make; } public String getMake() { return make; } public void setModel( String model) { this.model = model; } public String getModel() { return model; } public void printCarInfo() { System.out.println(getMake()+" "+getModel()+" "+ "with capacity "+getCapacity()+" and total miles " +getMiles()); } }...
View Full Document

This note was uploaded on 02/06/2010 for the course CSE CIS3023 taught by Professor Seema during the Spring '10 term at Florida College.

Page1 / 2

Car - } public int getCapacity () { return capacity; }...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online