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++)
}
}
what is the problem it does not generate the output the numOfStudents who take c++ n JAVA.please explain to me. i am not good in array...
xonxon -4 Light Poster
kekkaishi 18 Junior Poster
xonxon -4 Light Poster
kekkaishi 18 Junior Poster
kekkaishi 18 Junior Poster
xonxon -4 Light Poster
xonxon -4 Light Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.