Question: I wrote some code already in the second photo. I am trying to follow the instructions given in the outline, but I am confused reading



I wrote some code already in the second photo. I am trying to follow the instructions given in the outline, but I am confused reading my professor's code. The coding in the main method was written by my professor, it was the preset provided. I want to use an array because it is in the title, however I am not too familiar with the function of arrays. Thank you for your help!
Student list using object array Given a Student class, create a class with following characteristics The class name should be Class Room. Private variable students to maintain the list of Student objects. Function addStudent with input parameter name (string) and rollNoint) adds a new student in "students" list. Method getAllStudents should return all the students in ClassRoom. Input Jack Jones Marry where, First & Second line represent a student's name and roll number. And so on. Output 1 - Jack 2 - Jones 3 - Marry Assume that, Maximum "students" count can be 10. + Test Case(s) 1. import java.util.*; 3. class Student { 4 public String name; 5 public int rollno; 6 } 8 // Write your code here 9. class Class Room { 10 private int students; private int Jack; private int Jones; private int Mary; 15 16 Student[] studentArray = new Student[3]; 13 14 17 18 for (int i =0; i
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
