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
Q17: A class declaration consists of which of
Q18: Which of the following corresponds to a
Q19: Each object of a class has its
Q20: What mechanism does an object use to
Q21: Consider the following method comment and method
Q23: We want to create a class that
Q24: What is the name of the utility
Q25: What are the operations that any programmer
Q26: The javadoc utility is used to
A)assist the
Q27: Consider the following code to declare a
Unlock this Answer For Free Now!
View this answer and more for free by performing one of the following actions
Scan the QR code to install the App and get 2 free unlocks
Unlock quizzes for free by uploading documents