j**y 发帖数: 7 | 1 public class CashHolder {
private double amountHeld=0.0;
}
public void getCash() {
CashHolder wallet = new CashHolder();
// Lookup the Teller using RMI
Teller teller= (Teller) java.rmi.
Naming.lookup("//localhost/TellerObject");
// Withdraw 100.00 from account #9856432 and put it into
// Wallet.
teller.withdrawFunds("9856432",wallet,100.00);
// Go somewhere and spend it
..
}
How do you change the code above to allow teller.withdrawFunds() to update
the CashHolde | q*********u 发帖数: 280 | 2 这个是不是多选阿,
a 应该是的吧,
public class CashHolder {
private double amountHeld=0.0;
}
public void getCash() {
CashHolder wallet = new CashHolder();
// Lookup the Teller using RMI
Teller teller= (Teller) java.rmi.
Naming.lookup("//localhost/TellerObject");
// Withdraw 100.00 from account #9856432 and put it into
// Wallet.
teller.withdrawFunds("9856432",wallet,100.00);
// Go somewhere and spend it
..
}
How do you change the code above to allow teller.withdrawFunds() to
【在 j**y 的大作中提到】 : public class CashHolder { : private double amountHeld=0.0; : } : public void getCash() { : CashHolder wallet = new CashHolder(); : // Lookup the Teller using RMI : Teller teller= (Teller) java.rmi. : Naming.lookup("//localhost/TellerObject"); : // Withdraw 100.00 from account #9856432 and put it into : // Wallet.
| j**y 发帖数: 7 | |
|