hasx.java
来自「程序练习中包括书中实例程序代码和练习中要用到的代码,是压缩文件」· Java 代码 · 共 30 行
JAVA
30 行
package examples.inheritance;
/** A Java superclass to demonstrate inheritance
* concepts
*/
public class HasX {
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 write X to <code>System.out</code>
*/
public void showX() {
System.out.println( x );
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?