Tony Docherty wrote:Schoolcost should not be public. If it is needed by a sub class make it protected or default access else make it private. You should also follow Java naming standards and so it should be called schoolCost.
The GetVar class extends Layout so why are you creating a new instance of Layout here.
The Layout class does not have a method declared as getString(JTextField obj). Also you have used a different capitalization of schoolcost here so it is not the same variable as Schoolcost declared in the Layout class.
Why does this java style guide do everything so different from docs.oracle.com & most people on youtube, including the books I have looked at?
However as soon as I went into two classes I lost the ability to access my other class variables.
I think I could have completed the program without very much of a challenge using one class only, but I want to learn, and do it correctly from the start, so I wanted to make multiple classes.
Also lot's of the stuff in the comments I just don't understand because I'm very inexperienced with programming therms.
Would think if it is normal for a program to contain hundreds if not thousands of classes this kind of problem should have an easy solution.
You may decide to use access modifiers to permit or restrict access to that method; if you miss out the access modifier then the passport number method is only accessible inside your current package, and you can read about it here, but that may not be the most important thing for you to learn just at the moment.Tony Docherty wrote: . . . ie john.getPassportNumber();. . . .