This may be a generic OOP question. I wanted to do a generic comparison between an interface and an abstract class on the basis of their usage. When would...
In one of my interviews, I have been asked to explain the difference between an Interface and an Abstract class. Here’s my response: Methods of a Java interface are...
What is the difference? When should I use which? Why are there so many of them? 5 s 5
If class B and class C extend class A and I have an object of type B or C, how can I determine of which type it is an...
What’s the difference between: class Child(SomeBaseClass): def __init__(self): super(Child, self).__init__() and: class Child(SomeBaseClass): def __init__(self): SomeBaseClass.__init__(self) I’ve seen super being used quite a lot in classes with only single...
How do I call the parent function from a derived class using C++? For example, I have a class called parent, and a class called child which is derived...
When creating a simple object hierarchy in Python, I’d like to be able to invoke methods of the parent class from a derived class. In Perl and Java, there...
Please explain in an easy to understand language or a link to some article. 19 s 19 extends is for extending a class. implements is for implementing an interface...
What are the C++ rules for calling the base class constructor from a derived class? For example, I know in Java, you must do it as the first line...
In c++ what is object slicing and when does it occur? 18 s 18 Most answers here fail to explain what the actual problem with slicing is. They only...