我不明白下面的程序。我已经提到了我在代码中遇到的两个错误。但我无法理解原因
import java.io.*;
class sdata
{
float per;
int m,tm=0,i,n;
sdata(int n)throws Exception
{
DataInputStream dis2=new DataInputStream(System.in);
for(i=1;i<=n;i++)
{
System.out.print("enter marks of subject"+i);
int m=Integer.parseInt(dis2.readLine());
tm=tm+m;
}
per=tm/n;
}
}
class disdata extends sdata
{
//below line gives an error "constructor sdata in class xyz.sdata cannot be applied to given types required:int found:no arguments"
disdata() throws Exception{
System.out.println("TOTAL MARKS OF SUBJECTS:"+tm);
System.out.println("PERCENTAGE OF STUDENT:"+per);
}
}
class sresult
{
public static void main(String args[])throws Exception
{
DataInputStream dis=new DataInputStream(System.in);
int n=Integer.parseInt(dis.readLine());
disdata objj=new disdata();
//the below line creates an error saying "cannot find symbol"
objj.sdata(n);
}
}