30.3k views
1 vote
If you have defined a class SavingsAccount with a public static method get Number Of Accounts, and created a Savings Account object referenced by the variable account20, which of the following will call the get Number Of Accounts method?A. get Number Of Accounts.B. savings Account get Number Of Accounts.C. account 20.get Number Of Accounts.D. none of these.

User Abhic
by
3.6k points

2 Answers

5 votes

Answer:

numAccounts = SavingsAccount.numberOfAccounts or you use account20.getnumberofaccounts

Step-by-step explanation:

This is a Java question , our task here is to call the get number of accounts which we do by imputing the code above .

User StasK
by
4.1k points
1 vote

Answer:

C. account 20.get Number Of Accounts.

Step-by-step explanation:

Using the command;

"account 20.get Number Of Accounts." Or

"numAccounts=SavingsAccount.numberOfAccounts;" would call the get Number Of Accounts method.

User Tedil
by
4.0k points