Question: Suppose we have written a class called BankAccount with a method inside it, defined as: public double computeInterest(int rate) If the client code has declared
Suppose we have written a class called BankAccount with a method inside it, defined as:
public double computeInterest(int rate)
If the client code has declared a BankAccount variable named acct , which of the following would be a valid call to the above method?
a. double result = computeInterest(acct, 42);
b. acct.computeInterest(42.0, 15);
c. int result = BankAccount.computeInterest(42);
d. double result = acct.computeInterest(42);
e. new BankAccount(42).computeInterest();
Step by Step Solution
3.47 Rating (167 Votes )
There are 3 Steps involved in it
Correct syntax for cal... View full answer
Get step-by-step solutions from verified subject matter experts
