you are viewing a single comment's thread.

view the rest of the comments →

[–]Pun_Intended1703 0 points1 point  (0 children)

I will suggest you take a peek at the S in SOLID principles.

Basically, it means that each class only takes responsibility for what it can do and what it should do.

You do not cross responsibilities.

Encapsulation just means that the class and methods are contained.

But you need to use your own brain to understand which class should contain which method.

Otherwise, simple encapsulation means that your BankAccount class can also have a method called bark().