package pack;
import java.io.*;
import java.util.*;
class Samp1
{
public Samp1()//default constructor
{}
String name;
int empid;
float sal;
public Samp1(String name,int empid,float sal)
{
this.name=name;
this.empid=empid;
this.sal=sal;
}
public void disp(String name,int empid,float sal)
{
System.out.println("Name of the Employee:"+name);
System.out.println("Employee ID of the Employee:"+empid);
System.out.println("Salary of the Employee:"+sal);
}
}
class SubSamp1 extends Samp1
{
public static void main(String[] args) throws IOException
{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
System.out.println("Enter the EmpId:");
int empid=Integer.parseInt(br.readLine());
System.out.println("Enter the Name:");
String name=br.readLine();
System.out.println("Enter the Salary:");
float sal=Float.parseFloat(br.readLine());
super.Samp1(name,empid,sal);
}
}
In the about program i am getting an error at super key and the error is
"Cannot use super in a static context ".
Can anyone give me the solution for this problem