Found a question, can anyone help? | Sololearn: Learn to code for FREE!
Новый курс! Каждый программист должен знать генеративный ИИ!
Попробуйте бесплатный урок
- 1

Found a question, can anyone help?

How can you force a class to implement only features of our class? a. Only abstract class b. Only interface c. Abstract class or interface d. We cannot

11th Dec 2019, 4:56 AM
Ann Thomas
Ann Thomas - avatar
3 ответов
+ 2
Isn't it the final class you are looking for? Final classes cannot be extended so no functionality can be added.
11th Dec 2019, 5:43 AM
Gyorgy Theisz
Gyorgy Theisz - avatar
+ 1
with an interface the childclass has to implement all the parentclass methods with an abstract class the childclass gets all methods from its parent and has to overwrite all abstract methods
11th Dec 2019, 5:32 AM
Anton Böhler
Anton Böhler - avatar
+ 1
Only abstract class. Once a class declared abstract is derived from, all of the classes (abstract) methods are forced to be declared.
11th Dec 2019, 5:32 AM
coddy
coddy - avatar