public class SIM {
long num;
SIM(long num){
this.num=num;
}
long getNum(){
return num;
}
long num;
SIM(long num){
this.num=num;
}
long getNum(){
return num;
}
}
public class Phone {
SIM sim;
void setSIM(SIM card) {
sim=card;
}
long lookNum() {
return sim.getNum();
}
}
public class Test {
public static void main(String[] args) {
SIM sim1=new SIM(13889766509L);
Phone phone=new Phone();
phone.setSIM(sim1);
System.out.println("手机号码:"+phone.lookNum());
SIM sim2=new SIM(15588552059L);
phone.setSIM(sim2);
System.out.println("手机号码:"+phone.lookNum());
}
}