Question: The following statement creates a BankAccount array: BankAccount[] acc = new BankAccount[10]; Is it okay or not okay to execute the following statements? Acc[0].setBalance(5000.0); Acc[0].withdraw(100.0);

The following statement creates a BankAccount array:

BankAccount[] acc = new BankAccount[10]; 

Is it okay or not okay to execute the following statements? 

Acc[0].setBalance(5000.0);
Acc[0].withdraw(100.0);

Step by Step Solution

3.39 Rating (161 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

No it is not okay to execute the following sta... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Starting Out With Java From Control Structures Questions!