Skip to content

Instantly share code, notes, and snippets.

@awhitty
Created September 26, 2012 20:38
Show Gist options
  • Save awhitty/3790447 to your computer and use it in GitHub Desktop.
Save awhitty/3790447 to your computer and use it in GitHub Desktop.
class Car {
Door leftDoor, rightDoor;
Wheel leftFrontWheel, leftRearWheel, rightFrontWheel, rightRearWheel;
Car() {
Door leftDoor = new Door(true, false);
Door rightDoor
// other constructor things...
rightDoor.open();
}
}
class Door {
// instance variables describing a door go here
Door(boolean locking, boolean window) {
// construct a door here!
}
void open() {
// opens door
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment