OnJava8-Examples/reusing/SpaceShip.java
2015-04-20 15:36:01 -07:00

12 lines
342 B
Java

//: reusing/SpaceShip.java
public class SpaceShip extends SpaceShipControls {
private String name;
public SpaceShip(String name) { this.name = name; }
public String toString() { return name; }
public static void main(String[] args) {
SpaceShip protector = new SpaceShip("NSEA Protector");
protector.forward(100);
}
} ///:~