Create a new project in BlueJ. Create two new classes in the project, with the following specifications:
Class name: Runner
Fields:
1 Constructor: takes parameters runnerBibId, raceEvent, and runnerRaceDayAge as parameters to initialize fields
Methods: Write get-methods (getters) for all three fields. The getters should be named getBibId, getEvent, and getAge.
Save the project as a jar file to submit.
Runner class:
// Runner.java public class Runner { // Fields private int bibId; private String event; private int age; // Constructor public Runner(int runnerBibId, String raceEvent, int runnerRaceDayAge) { // Initialize fields this.bibId = runnerBibId; this.event = raceEvent; this.age = runnerRaceDayAge; } // Getters public int getBidId() { return this.bibId; } public String getEvent() { return this.event; } public int getAge() { return this.age; } }
Kindly rate the answer and for any help just drop a comment
Get Answers For Free
Most questions answered within 1 hours.