put System.out.println()
inside your main()
method.
public class BankAccount {
public static void main(String[] args) {
Test t1 = new Test("tim",147,5);
System.out.println("name = "+t1.getBalance());
}
}
You need to change your constructor of Test
too.
Test (String n,int h,int b) {
this.name=n;
this.houseno=h;
this.balance=b;
}