so I have a java class called User that contains a constructor like this:
public class User extends Visitor {
public User(String UName, String Ufname){
You must call the Visitor
's constructor on the first like of the constructor that extends the Visitor
's class, using super()
:
public User(String UName,String Ufname){
super();
setName(UName);
setFname(Ufname);
}
and if you want Admin to have a custom constructor too, you must call:
super(uname, ufname) // String, String - pass the params of the superclass cunstructor
So:
public Admin() {
super(someString, someString);
}