mystuff.java
来自「JAVA源代码程序aashjkjhkjhkjhjkhkj」· Java 代码 · 共 115 行
JAVA
115 行
/** * MyStuff classes */public class MyStuff { private String name ; public void setName(String n) { name = n ; } // end of method setName public String getName() { return name ; } // end of method getName } // end of class MyStuffclass Person extends MyStuff { } // end of class Personclass Student extends Person implements Moveable { // implementing Moveable interface methods private int x, y ; public void setLocation(int xl, int yl) { x = xl ; y = yl ; } // end of method setLocation public int getXLocation() { return x ; } // end of method getXLocation public int getYLocation() { return y ; } // end of method getYLocation } // end of class Studentclass Vehicle extends MyStuff { } // end of class Vehicleclass LandVehicle extends Vehicle { } // end of class LandVehicleclass Car extends LandVehicle implements Moveable { // implementing Moveable interface methods private int x, y ; public void setLocation(int xl, int yl) { x = xl ; y = yl ; } // end of method setLocation public int getXLocation() { return x ; } // end of method getXLocation public int getYLocation() { return y ; } // end of method getYLocation } // end of class Carclass AirVehicle extends Vehicle { } // end of class AirVehicleclass SeaVehicle extends Vehicle { } // end of class SeaVehicleclass Animal extends MyStuff { } // end of class Animalclass Feline extends Animal implements Moveable { // implementing Moveable interface methods private int x, y ; public void setLocation(int xl, int yl) { x = xl ; y = yl ; } // end of method setLocation public int getXLocation() { return x ; } // end of method getXLocation public int getYLocation() { return y ; } // end of method getYLocation } // end of class Felineclass Canine extends Animal { } // end of class Canine
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?