Question: This class has no syntax errors. Is there anything wrong with it? (choose all that apply) public class BankAccount{ private double balance; public BankAccount() {


This class has no syntax errors. Is there anything wrong with it? (choose all that apply) public class BankAccount{ private double balance; public BankAccount() { balance = 0.0; } public double getBalance (double bal) { return balance; } public void withdraw(double amt) { balance -= amt; } public void deposit(double amt)|| { balance += amt; } public void printBalance() { System.out.println (balance); } } The getBalance method should not have a parameter The getBalance method should not have a parameter The deposit and withdraw methods should make sure the value of "amt" is not negative The withdraw method should make sure the balance won't be negative There is nothing wrong with it There should not be a printBalance method because this makes the class dependent on System.out
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
