Logo 
Search:

Java Answers

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds
  Question Asked By: Hamish Jones   on Jul 23 In Java Category.

  
Question Answered By: Josie Roberts   on Jul 23

Does your BankAccount class have get method  to access the
Account Number? You can use that in the println.

private void  openNewAccount()
{

// prompt  for initial deposit
int startup  = atm.readInt( "Initial deposit: " );

// create  newAccount
BankAccount newAccount = new BankAccount( startup, this );

// @@@DeMarco add  it to accountList
accountList.add(newAccount);

// @@@DeMarco inform user  without including account number
atm.println( "opened new account " + newAccount.getAccountNumber()
+ " with $" + newAccount.getBalance());

}

Share: 

 

This Question has 2 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on myArrayList.get() Or get search suggestion and latest updates.


Tagged: