public class Sim {
int cost=0;
int number;
public void setNumber(int number) {
this.number = number;
}
}
public class phone {
void change()
{
System.out.println("请插入手机的Sim卡");
}
int cost(Sim s)
{
s.cost=s.cost+10;
return s.cost;
}
//getphonenumber()
}
public class Testphone {
public static void main(String[] args) {
// TODO Auto-generated method stub
phone xiaomi=new phone();
Sim sim=new Sim();
sim.setNumber(136010);
System.out.println("已更换完毕");
xiaomi.change();
System.out.println("话费已使用"+xiaomi.cost(sim)+"元");
}
}
int cost=0;
int number;
public void setNumber(int number) {
this.number = number;
}
}
public class phone {
void change()
{
System.out.println("请插入手机的Sim卡");
}
int cost(Sim s)
{
s.cost=s.cost+10;
return s.cost;
}
//getphonenumber()
}
public class Testphone {
public static void main(String[] args) {
// TODO Auto-generated method stub
phone xiaomi=new phone();
Sim sim=new Sim();
sim.setNumber(136010);
System.out.println("已更换完毕");
xiaomi.change();
System.out.println("话费已使用"+xiaomi.cost(sim)+"元");
}
}