Question
public class TestCourse{ public static void main(String[] args){ Course course1 = new Course(Data structure) ; Course course2 = new Course(Database systems); course1.addStudent(peter jones); course1.addStudent(kim smith);
public class TestCourse{
public static void main(String[] args){
Course course1 = new Course("Data structure") ;
Course course2 = new Course("Database systems");
course1.addStudent("peter jones");
course1.addStudent("kim smith");
course1.addStudent("Anne Kennedy");
couse2.addStudent("peter jones");
course2.addStudent("steve smith");
System.out.println("number of students in course1:" + course1.getNumberOfStudents());
String[] Students = course1.getstudents();
for (int i=0; i< course= course1.getstudents(); i++)
System.out.print(students[i] + ","); System.out.println();
System.out.print("number of students in course2" +course2.getNumberOfStudents());
System.out.println("number of books in course1" + course1.getNumberofStudents());
string[] books = course1.getbooks();
for (int i=0; i< course= course1.getbooks();i++){ System.out.print(books[i] + ",");
System.out.println();
System.out.print("number of books in course2" +course2.getNumberOfBooks());
}
}
}
Can anyone help me fix this code,thank you
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started