0

Hey just started working with inheritance in my java class, my account class compiles fine, but i get a .class expected error when i try to compile the CheckingAccount class, can anyone tell me why? thx

package bank;
abstract class Account
{
   public Account(int accountNumber, String accountOwner)
   {
       number = accountNumber;
       owner = accountOwner;
   }
   
   public int getAccountNumber()
   {
       return number;
   }
   
   abstract double getBalance();
   abstract void makeDeposit(double amount);
   abstract void makeWithdrawal(double amount);   
private int number;
private String owner;
}
package bank;
public class CheckingAccount extends Account
{
    public CheckingAccount(int accountNumber, String accountOwner)
    {
        super(int accountNumber, String accountOwner);
    }
    
    public CheckingAccount(int accountNumber, String accountOwner, double deposit)
    {
        super(int accountNumber, String accountOwner);
        balance =+ deposit;
    }
    
    public double getBalance()
    {
        return balance;
    }
    
    public void makeDeposit(double amount);
    {
        balance =+ amount;
    }
    
    public void makeWithdrawal(double amount);
    {
        balance =- amount;
    }   
private double balance;    
}

Edited by Shotty: n/a

2
Contributors
2
Replies
3
Views
6 Years
Discussion Span
Last Post by Shotty
0

Take the variable types out of your super() calls

super(int accountNumber, String accountOwner);

You just pass the variables themselves.

super(accountNumber, accountOwner);
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.