📄 cloneable1.java
字号:
public class Cloneable1 implements Cloneable{
String s;
int a;
public Cloneable1(String s, int a){
this.s=s;
this.a=a;
}
public Object clone(){
try{
return super.clone();
}catch(CloneNotSupportedException cse){}
return null;
}
public static void main(String[] args){
Cloneable1 ob1 =new Cloneable1("abcd", 10);
Cloneable1 ob2 =(Cloneable1)ob1.clone();
System.out.println("盔夯: "+ob1.hashCode());
System.out.println("汗力: "+ob2.hashCode());
System.out.println("盔夯: "+ob1.s+" "+ob1.a);
System.out.println("汗力: "+ob2.s+" "+ob2.a);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -