+ 1

I want to display firstname to parentfirst and lastname to parentsecond in my child class. I have one error.

Two parent class. https://code.sololearn.com/cgA133UZ0Nle/?ref=app

11th Jun 2020, 7:05 AM
Malick Diagne
Malick Diagne - avatar
2 Answers
+ 7
In Java, A class can extend only one class. A work around would be to use interfaces. On line 2 , `string` should be `String`.
11th Jun 2020, 7:09 AM
šŸ‡®šŸ‡³OmkaršŸ•‰
šŸ‡®šŸ‡³OmkaršŸ•‰ - avatar
+ 2
Malick Diagne Multiple Inheritance (extends more than one class) is not allow in Java so better to use interface. Btw string will be String. You can impliment multiple interface but can't extends multiple classes.
11th Jun 2020, 7:14 AM
AĶ¢J
AĶ¢J - avatar