java - encapsulation means putting related items together? -


I was going through and it has been said that encapsulation means that related items should be put together, but I do not know the example of an article representative: UserProfile.js Although this example is in JavaScript, I am looking to understand these concepts in java .

Can anyone tell me these two questions with a pseudo-code:

  1. What is the encapsulation?
  2. Why do we need encapsulation with a proxy code?

    Michael has corrected it.

    Object Oriented Programming Encapsulation is the first step in encapsulation, the process of covering data and tasks in an entity (data is called). An encoded object is often called an intangible data type.

    Ref:

    Encapsulation is essential for hidden features.

    So why do we need it?

    P> Programming To solve that problem, it is about translating a solution to a problem in a logical code. Because of this, there are many complex methods and functions that we do not want to use that Joe Four developer. We will cover those methods (or blackboxes) so that they can not be used (they are still used internally) by reducing complexity by representing important tasks and hiding others.

    To put it in a pseudo-code, I'm not sure.

    I have not enough coffee to give a good example, plus the break of my Rubik cube :(, I will write one for you.

Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

c# - Using Vici cool Storage with monodroid -

python - referencing a variable in another function? -