The below code is showing error i checked lots of time didn't find any error please help me.
class emp{
int id,sal;
String name;
emp(int id,int sal,String name)
{
this.id=id;
this.sal=sal;
this.name=name;
}
void show()
{
System.out.println("Name: "+name);
System.out.println("Salary: "+sal);
System.out.println("ID: "+id);
}
}
class manager extends emp{
int bonus;
manager(int id,int sal,String name,int bonus)
{
this.id=id;
this.sal=sal;
this.name=name;
this.bonus=bonus;
}
}
class inherit{
public static void main(String arg[])
{
emp e1=new emp(1000,58000,"rohit");
manager m1=new manager(1001,98000,"Aman",5000);
e1.show();
m1.show();
}
}
following is error
inherit.java:26: cannot find symbol
symbol : constructor emp()
location: class emp
{
^
1 error