i get an exception when i run my Main Class :exception on Thread's
i using run method, and it look like this :
@Override
public synchronized void run() {
// TODO Auto-generated method stub
int randomNum = ThreadLocalRandom.current().nextInt(1, 4);
Student studentThread = new Student();
Inlay inlayThread = new Inlay();
studentThread.setId(counter);
inlayThread.setInlayId(randomNum);
Course courseThread = new Course();
courseThread.setInlayD(inlayThread);
courseThread.setStudentD(studentThread);
this.arrCourse.add(courseThread);
System.out.println(courseThread.toString());
counter++;
}
and my Main :
Course c = new Course();
for(int i = 0 ; i<200;i++)
{
Thread t = new Thread(c);
t.start();
}
c.toString();
what is tihs exception say ?
thanks !