📄 debug7_2.java
字号:
package questions.c7;
class Debug7_2_Base {
private int x;
int getX() {
return x;
}
public void setX( int newX ) {
x = newX;
}
}
public class Debug7_2 extends Debug7_2_Base
implements Cloneable {
StringBuffer sb
= new StringBuffer( "Inventory count" );
public Object clone()
throws CloneNotSupportedException {
Debug7_2 result = new Debug7_2();
result.sb
= new StringBuffer( this.sb.toString() );
return result;
}
public static void main( String[] args )
throws CloneNotSupportedException {
Debug7_2 a = new Debug7_2();
a.setX( 300 );
Debug7_2 b = (Debug7_2) a.clone();
System.out.println( b.sb + " " + b.getX() );
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -