这是我的整个代码在命令提示符中出现以下错误。请帮助我解决它,这里是初学者。
"Student.java:36: error: cannot find symbol
s[i].Student();
^
symbol: method Student()
location: class Student
1 error"
import java.util.*;
public class Student
{
int roll;
String name=new String();
Student()
{
Scanner sc=new Scanner(System.in);
System.out.println("Enter Name");
name=sc.next();
System.out.println("Enter Roll No");
roll=sc.nextInt();
}
public String toString()
{
return "Name:"+name+" "+"Roll Number:"+roll ;
}
}
class Main
{
public static void main(String args[])
{
int n,i;
Scanner sc=new Scanner(System.in);
System.out.println("Enter the number of students");
n=sc.nextInt();
Student s[]=new Student[n];
for(i=0;i<n;i++)
{
s[i]=new Student();
s[i].Student();
}
for(i=0;i<n;i++)
{
System.out.println(s[i]);
}
}
}