Problem:
Hello all,
Please explain to me the error in the following program.
class test
{
String name="name";
public person(String nm){name=nm;}
}
class emp extends test
{
String empid="0000";
}
public class emptest
{
public static void main(String args[])
{
test p=new test("hello");
System.out.println(p.test);
}
}
The error I am getting is:
javac emptest.java
emptest.java:8: error: constructor test in class test cannot be applied to given types;
class emp extends test
required: String
found no arguments
reason: actual and formal argument lists differ in length
Thanks for the effort.
Best regards