Java – Three class template.
In the grade 11 exam you are expected to write applications with at least three classes i.e.
- A UI class. Creates the manager class. Calls the methods it needs. May have some input and output.
- A manager class for all your methods.
- A template class from which you will instantiate objects. Will have your “getter” and “setter: methods and a toString method(s).
An important technique is to write a bare-bones class with very little code, BUT it runs. THEN you can study the exam paper and begin to add the specifics. Obviously name the classes to match the exam paper.
Here is a template model of a three class application for you to study and use in your exams. Click on the links and download – you may have to open it in Wordpad before you cut-and-paste the code into NetBeans where you can run it.
Template class from which to create objects
OUTPUT: see below