Bank Class
public class Bank{
private CheckingAccount accountOne;
private CheckingAccount accountTwo;
public Bank(){
accountOne = new CheckingAccount("Zeus", 100, "1");
accountTwo = new CheckingAccount("Hades", 200, "2");
}
public static void main(String[] args){
Bank bankOfGods = new Bank();
System.out.println(bankOfGods.accountOne.getBalance());
}
}
Checking Account Class
public class CheckingAccount{
private String name;
private int balance;
private String id;
public CheckingAccount(String inputName, int inputBalance, String inputId){
name = inputName;
balance = inputBalance;
id = inputId;
}
//Write new methods here:
**public int getBalance() {**
** return balance;**
** } // getBalance method**
}
Exception Error
Error: Main method not found in class CheckingAccount, please define the main method as:
public static void main(String args)
or a JavaFX application class must extend javafx.application.Application
Hi, I am having a problem creating the accessor method. Based on the examples in the lesson I though I had this down. Please help explain what I am doing wrong. Not looking for the answer, looking for help to learn.
Thank you!