I'm a newbie in java and while i'm doing coding for the sitting plan the counsole kept giving me errors Please help >.<
This is the class for SittingPlan
public SittingPlan()
{
String[] name = {"charles" };
String[] sex = {" Girl", "Boy"};
Students[] names = new Students[NUMBER_OF_STUDENTS];
currentStudents = 0;
for ( int count = 0; count < names.length; count++ )
names [ count ] = new Students ( name [count % 22 ], sex [ count / 22 ]);
}
public void shuffle()
{
currentStudents = 0;
SittingPlan.shuffle.setName();
for ( int first = 0; first < names.length; first++ )
{
int second = randomNumbers.nextInt ( NUMBER_OF_STUDENTS );
Students temp = names[ first ];
names[ first ] = names[ second ];
names[ second ] = (Students) temp;
}
}
public Students dealStudents()
{
if ( currentStudents < names.length )
return (Students) names[ currentStudents++ ];
else
return null;
}
and this is the stacktrace
Exception in thread "main" java.lang.Error: Unresolved compilation problem: shuffle cannot be resolved or is not a field
at SittingPlan.shuffle(SittingPlan.java:22)
at mainlaunch.main(mainlaunch.java:6)