Multiple Choice
We want to change the BankAccount class so that all accounts will have a monthly fee.The instance variable monthlyFee will hold the monthly fee.Which of the following constructors properly sets the monthly fee to a default value of 20?
A) public BankAccount (double initialBalance)
{
balance = initialBalance;
monthlyFee = 20;
}
B) public Bankaccount (double initialBalance)
{
balance = initialBalance;
double monthlyFee = 20;
}
C) public BankAccount (double initialBalance)
{
balance = initialBalance;
monthlyFee = initialBalance-20;
}
D) public BankAccount (double initialBalance)
{
balance = initialBalance-20;
}
Correct Answer:

Verified
Correct Answer:
Verified
Q67: The class constructor always has the same
Q68: What will be output from the following
Q69: What is the name of the instance
Q70: What statement is used to specify the
Q71: The public constructors and methods of a
Q73: What mechanism does an object use to
Q74: We want to change the BankAccount class
Q75: Which of the following corresponds to the
Q76: We want to change the BankAccount class
Q77: When are instance variables initialized?<br>A)Instance variables are