hasx2.java

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

JAVA
27
字号
package examples.inheritance;

/** A Java superclass to demonstrate inheritance
  * concepts
  */
public abstract class HasX2 {

   private int x;

   /** Method to set the value of the object
     * @param inputX The field's new value
     */
   public void setX( int inputX ) {
      x = inputX;
   }

   /** Method to get the value of the object
     * @return The value of the field
     */
   public int getX() {
      return x;
   }

   /** Method to somehow display the X value
     */
   public abstract void showX();
}

⌨️ 快捷键说明

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