Question
Public class BankAccount { private double balance; private String name; private int acctNumber; public BankAccount (String initName , int acct ) { name=initName; acctNumber=acct; balance=0.0;
Public class BankAccount {
private double balance; private String name; private int acctNumber;
public BankAccount (String initName , int acct ) { name=initName; acctNumber=acct; balance=0.0; }
public void deposit(double amt) { balance=balance+amt; }
public void withdraw(double amt) { balance=balance-amt; }
public double getBalance() { return balance; }
}
public class BankTester { // identifier public static void main(String args[]);
//create bank account BankAccount bat = new BankAccount(); //deposit the 1000 bat.deposite(1000); //print the balance bat.print(); //withdraw the 500 bat.widthdraw(500); bat.print();
//widthdraw(400); bat.widthdraw(400);
bat.print();
}
Can Someone help with the error i get this in terminal.
"/BankTester.java:1: error: class, interface, enum, or record expected Public class BankAccount { ^ /BankTester.java:39: error:
how can i fix this. thank you . If you cannot provide a solution dont answer thanks
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access with AI-Powered Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started