public class BankAccount{
public static void main(String[] args) {
Value v1 = new Value();
v1.v = 10000;
Value v2 = new Value();
v2.v = 3000;
Value v3 = new Value();
v3.v = 4000;
System.out.println("原存款"+v1.v);
System.out.println("存款"+v2.v);
BankAccount b = new BankAccount();
b.deposit(v1,v2);
System.out.println("存款后余额"+v1.v);
System.out.println("取款"+v3.v);
b.withDrawals(v1,v3);
System.out.println("取款后余额"+v1.v);
}
public void deposit(Value x,Value y){
x.v += y.v;
}
public void withDrawals(Value x,Value z){
x.v -= z.v;
}
}
class Value{
int v;
}
public static void main(String[] args) {
Value v1 = new Value();
v1.v = 10000;
Value v2 = new Value();
v2.v = 3000;
Value v3 = new Value();
v3.v = 4000;
System.out.println("原存款"+v1.v);
System.out.println("存款"+v2.v);
BankAccount b = new BankAccount();
b.deposit(v1,v2);
System.out.println("存款后余额"+v1.v);
System.out.println("取款"+v3.v);
b.withDrawals(v1,v3);
System.out.println("取款后余额"+v1.v);
}
public void deposit(Value x,Value y){
x.v += y.v;
}
public void withDrawals(Value x,Value z){
x.v -= z.v;
}
}
class Value{
int v;
}