OnJava8-Examples/reusing/SpaceShip.java

13 lines
354 B
Java
Raw Normal View History

2015-04-20 15:36:01 -07:00
//: reusing/SpaceShip.java
public class SpaceShip extends SpaceShipControls {
private String name;
public SpaceShip(String name) { this.name = name; }
2015-05-05 11:20:13 -07:00
@Override
2015-04-20 15:36:01 -07:00
public String toString() { return name; }
public static void main(String[] args) {
SpaceShip protector = new SpaceShip("NSEA Protector");
protector.forward(100);
}
} ///:~