Question: sysc2004 code of student class sysc2004. main va Student.java ublic class Main { public static void main(String[] args) { 9 A6 X5 // initialize a
![Main { public static void main(String[] args) { 9 A6 X5 //](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f4552c308b5_61966f4552bbfc6f.jpg)


main va Student.java ublic class Main { public static void main(String[] args) { 9 A6 X5 // initialize a new Student object Student s1 = new Student ( name: "James", id: "100010001"); // creating some courses Course course1 = new Course( title: "ML", code: "sysc4906"); Course course2 = new Course( title: "OM", code: "elec4705"); Course course3 = new Course( title: "OOP", code: "sysc2004"); Course course4 = new Course( titie: "C". code: "sysc2006"); Course course5 = new Course( title: "OR", code: "sysc3200"); // adding the student to all these courses s1.addCourse (coursel); s1.addCourse(course2); s1.addCourse (course3); s1.addCourse(course); 1/ add a call to your created accessor method here print out the call to getFullLoad() Il adding the final course s1.addCourse (course5); // add another call to your created accessor method here print out the call to getFullLoad() In the main method we created our Student "James" and added him to some courses. However, there is a problem. There is no accessor method for our fullLoad attribute. Time to add one! Go into the Student class and create a new accessor method called getFullLoad() . Pay attention to your access modifiers and the return type (we want to return the actual value of the field, not print it out). Then back in Main.java , make two calls to your new method to test that it actually works. Run it! Really try it before peeking the solution. import java.util.ArrayList; 1 A8 public class Student { private String name; private String id; private ArrayList
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
