Suppose we have written a class called BankAccount with a method inside it, defined as: public double

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 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();

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question
Question Posted: