Skip to content

Instantly share code, notes, and snippets.

@ornirus
Last active October 14, 2015 12:31
Show Gist options
  • Save ornirus/411347cf73cec59dc0d8 to your computer and use it in GitHub Desktop.
Save ornirus/411347cf73cec59dc0d8 to your computer and use it in GitHub Desktop.
public class Car extends vehicle {
public boolean sunroof, childSeat, electric;
public Car(boolean x, y, z) {
sunroof = x;
childSeat = y;
electric = z;
}
public boolean getSunroof() {
return sunroof;
}
public void setSunroof(boolean x) {
sunroof = x;
}
}
public class Truck extends vehicle {
public boolean trailer;
public int loadMass;
public Truck(boolean x, int y) {
trailer = x;
loadMass = y;
}
public boolean getSunroof() {
return sunroof;
}
public void setSunroof(boolean x) {
sunroof = x;
}
}
public class Vehicle {
public int wheels, seats, people;
public String color, model;
public static void main(String[] args) {
Car car = new Vehicle();
Truck truck = new Vehicle();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment