Basically I've made 4 classes, 1 main class, which 3 classes are then extended by. This is the main class file:
public class Account { private float balance; float getBalance() { return balance; } }
A class file that extends on this is:
public class Second extends Account { private float balance; public Loan(float loanBalance) { balance = loanBalance; } }
My main class file is:
public class Main { public static void main(String[] args) { Second JoeLoan = new Second(2000); float f = JoeLoan.getBalance(); System.out.println(f); } }
This should ideally output 2000.0, however it outputs 0.0... any idea what could be wrong?