+ 4

About inheritance in java

if we have super class people and there are 3 parameters in people constructor then we are deriving a class student from people but we want 4 parameters in student and want to use base class 3 parameters and fourth one seperately how I can implement I have error incompatible type

5th Dec 2017, 7:48 PM
कामेश
कामेश - avatar
2 Respostas
+ 4
"I have error incompatible type" Post your code into Code Playground and post the link to us so we can see what you've tried. If nothing more, copy/paste the actual error.
5th Dec 2017, 7:49 PM
AgentSmith
+ 3
Without reading your code maybe you want to pass the the four parameters in the People constructor and then the three parameters required for the superclass using the super () method which is a call to the constructor of your superclass and hopefully it may resolve then.
6th Dec 2017, 1:15 AM
Tarantino
Tarantino - avatar