This is my parent class
public abstract class Human {
public Human(String name,String surname, int idno){
}
}
And this is subclass
public class Personel extends Human {
public Personel(String name,String surname, int idno)
{
}
}
personels constructor doesnot have to be same with parent class's but what ever i do, it gives error.
I will add
final regnumber
to personel
, it cant be changed but i cant add this.
Why cant i make this:
public Personel()
{todo
}
or
public Personel();
or
public Personel(String name,String surname, int idno,int asda, string asdsa)
{
}
or
public Personel(final regnum)
{
}
If you help, i will be glad.
I did that, thanks but now i want to take inputs from user than make for example human1 object.
I have a main class, i want to create an object Human human1=new human();
What can i do now? It doesnot accept.
Human human1=new human(); i have to put in parantheses but i want to take from user, but i defined in constructor 3 parameters so, before class should i do that?