Top "Oop" questions

Object-oriented programming is a programming paradigm using "objects": an encapsulation consisting of data fields and methods together with their interactions.

How can I access "static" class variables within class methods in Python?

If I have the following python code: class Foo(object): bar = 1 def bah(self): print(bar) f = Foo() f.bah() …

python oop static-variables
When do I have to use interfaces instead of abstract classes?

I was wondering when I should use interfaces. Lets think about the following: public abstract class Vehicle { abstract float getSpeed(); } …

java oop inheritance interface abstract-class
How do I initialize the base (super) class?

In Python, consider I have the following code: >>> class SuperClass(object): def __init__(self, x): self.x = …

python oop
Interface vs Base class

When should I use an interface and when should I use a base class? Should it always be an interface …

oop interface language-agnostic base-class static-typing
Encapsulation vs Abstraction?

Here are the brief definitions of encapsulation and abstraction. Abstraction: The process of abstraction in Java is used to hide …

java oop
What's the difference between abstraction and encapsulation?

In interviews I have been asked to explain the difference between abstraction and encapsulation. My answer has been along the …

oop encapsulation abstraction
C++ equivalent of java's instanceof

What is the preferred method to achieve the C++ equivalent of java's instanceof?

java c++ oop instanceof
Should __init__() call the parent class's __init__()?

I'm used that in Objective-C I've got this construct: - (void)init { if (self = [super init]) { // init class } return self; } …

python oop superclass
What is the difference between an Instance and an Object?

What is the difference between an Instance and an Object? Is there a difference or not?

oop object instance
What does 'low in coupling and high in cohesion' mean

I have problems understanding the statement low in coupling and high in cohesion. I have googled and read a lot …

oop ooad