Skip to content

Commit 8d614e5

Browse files
authoredJun 20, 2020
Update README.md
1 parent b1290c8 commit 8d614e5

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed
 

‎Classes/README.md

+9
Original file line numberDiff line numberDiff line change
@@ -85,3 +85,12 @@ public class Vars
8585
}
8686
}
8787
```
88+
89+
### One of the big three in OOP. There is Encapsulation, Inheritance and Polymorphism.
90+
### Encapsulation is the process by which we hide the inner details of something. This way will enable us to not expose everything to the whole world.
91+
### Encapsulation takes place a lot when working with class level variables/fields. So we created a variable within the class method not within the method. This
92+
### variable will be accessible all throughout the class. When we instantiate an object of the class. When we work with the variable we are using encapsulation
93+
### when working with getter and setter methods of that variable. To get the value of the variable we have to go through the getter and this will output the value
94+
### back to us in the console. If we want to set the value of the variable we have to go through the setter and it will update the value.
95+
### Within the methods, we can modify and tweak it a little bit. Think of a service you are providing to people we can use encapsulation that way we hide the inner
96+
### workings and the user will not be able to see it. We can swap the inner workings without affecting the interface.

0 commit comments

Comments
 (0)
Please sign in to comment.