Last active
October 14, 2015 12:31
-
-
Save ornirus/411347cf73cec59dc0d8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | |
} | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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