bicycle.java

来自「程序练习中包括书中实例程序代码和练习中要用到的代码,是压缩文件」· Java 代码 · 共 14 行

JAVA
14
字号
class Vehicle {
   protected void goSomewhere() {
      System.out.println( "travelling..." );
   }
}
public class Bicycle extends Vehicle {
   public void goSomewhere() {
      System.out.println( "pedalling..." );
   }
   public static void main( String[] args ) {
      Bicycle x = new Bicycle();
      x.goSomewhere();
   }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?