A
A
Alina Mitrokhina2019-10-10 17:48:40
Java
Alina Mitrokhina, 2019-10-10 17:48:40

How to tell about OOP as clearly and confidently as possible?

How to correctly formulate the essence of OOP. Tell me about encapsulation, polymorphism and inheritance? I recently found myself thinking that I use all of this, but I can not adequately define it. And I would like to find out how you yourself can explain these three principles to yourself? I hope someone will share a story about how exactly he talked about OOP in an interview.

Answer the question

In order to leave comments, you need to log in

4 answer(s)
A
Anton R., 2019-10-10
@fursa08

This is the problem that everyone is told about OOP using "these three principles" although the essence is different - that OOP is programming with Objects that exchange messages and use each other to perform tasks. And only after that people should be told about "these three principles"!
To explain the essence of something, you need to answer 3 questions:
- What does he do?
- How he does it?
- What is it for?

S
Sergey Litvinov, 2019-10-11
@SeApps

I hope someone will share a story about how exactly he talked about OOP in an interview.

I was once asked about the three principles, I answered - "inheritance - everything is clear with it, encapsulation - hiding data, polymorphism - ... when many different objects give the same result." Not the most beautiful option, but the interviewer understood everything and we moved on.
Why did you add kotlin to the tags?)

S
StepEv, 2019-10-17
@StepEv

These principles do nothing if there is no understanding of how to apply them in practice, and the skill of this application. I often come across the fact that the principles can tell something, explain why they, alas, no longer exist.
I recommend the book "Using UML 2.0 and Design Patterns" by Craig Larman. In theory, after reading the questions should not remain. Well, you can then polish it with this book https://habr.com/ru/post/140284/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question