title: Hurdle with inheritance in Java
body: <p>I dont understand the program below. I have mentioned the two errors I have encountered in the code. But I cannot understand the reason</p>
  
  <pre><code>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&lt;=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);
      }
  }
  </code></pre>