import java.util.*;
public class course
{
static Scanner sc=new Scanner(System.in);
public static void main(String[]args)
{
String name,students,addStudent;
int numberOfStudents;
String courseName,getName,getStudents;
int getnumberOfStudents;
Course course1=new Course("C++");
Course course2=new Course("Java");
course1.addStudent("Peter");
course1.addStudent("Brian");
course1.addStudent("Anne");
course2.addStudent("Peter");
course1.addStudent("Steve");
System.out.println("Num of student in course1:"+course1.getnumberOfStudents());
String[]students=course1.getStudents();
for (int i = 0; i < course1.getNumberOfStudents(); i++)
System.out.println("Num of student in course2:"+course2.getnumberOfStudents());
String[]students=course2.getStudents();
for (int i = 0; i < course2.getNumberOfStudents(); i++)
}
}
C:\Documents and Settings\Administrator\Desktop\course\src\course.java:37: illegal start of expression
}
^
C:\Documents and Settings\Administrator\Desktop\course\src\course.java:38: reached end of file while parsing
}2 errors
Process completed.
this is the error and i cant understand. the errors is in the last 2 lines which are the last 2 brackets.....
already change the getNumberOfStudents to getnum....
but same error generated
actually the Question is like this:
create 2 courses which are c++ n java
then, add students to c++ n java
print out the num of students taking c++ and the list of their names
print out the num of students taking java and the list of their names