Can someone help me in debugging this code please. Its giving the error saying ; is expected for the end of while condition. I dont understand why.
import java.util.List;
import java.util.List.ArrayList;
import java.util.comparator;
import java.util.collections;
import java.util.Enumeration;
class Student{
private int sno;
private
String sname;
Student(int i, String name)
{
sno = i;
sname = name;
}
public int getsno()
{
return sno;
}
public String getName()
{
return Sname;
}
} //end of Student
class ArrayListComparator
{
public static void main(String [] args)
{
List<Student> stu = new ArratList<Student>();
stu.add(new Student(1,"Siri"));
stu.add(new Student(2,"Shiva"));
stu.add(new Student(3,"Shruti"));
stu.add(new Student(4,"Sidd"));
Enumeration<Student> e = stu.elements();
While(e.hasMoreElements())
// giving an error here saying ; is expected
{
Student s = (Person)e.nextElement();
System.out.println("Stu No \t Stu Name");
System.out.println(s.getsno() +"\t" +s.getName());
}
}
Thank you