I was once asked in an interview \'What are the 3 main concepts of OOP?\'. I answered by saying that in my opinion there were 4 which are as follows:
The four pillars are as your correctly state
Encapsulation deals with containing data, nothing more, nothing less.
Abstraction deals with data abstraction, i.e. is all this data really relevant. Think of a bank which contains information on name, age, address, eye colour, favourite tie, etc. Are eye colour and favourite tie really that relevant to the banks requirements? No. This is abstraction.
Inheritance deals with generalisation. Information which can apply to more than one thing. If something inherits from something then it can be said to be a more specific type of that thing. For example, Animal. A Dog is a type of Animal, so Dog inherits from Animal. Jack Russell is a type of Dog, so Jack Russell inherits from Dog.
Polymorphism deals with things having multiple forms, (poly - morph). Two kinds in programming,
You refer to something as it's general type and hence the compiler does not know what to bind at compile time. Think method Overriding.
Early Binding
int add(int a, int b) vs double add(double a, double b)These are essentially the basic principles of Object Orientation. There is a lot of overlap between these and so it is quite important to achieve a clear understanding of what each of these mean.