java wrapper

Java encapsulation


1. Encapsulation is to hide the data information (the properties or methods inside are private). If some public interfaces are not provided, the outside classes cannot access the properties or methods inside.
2. That is, the property or method is set to private, and then the public interface is provided for the property or method that is open to the outside world.


Benefits:
1. Good encapsulation can reduce coupling. (An object encapsulates its own properties and methods, so it can complete its own operations without relying on other objects.)
2. The internal structure of the class can be freely modified.
3. More precise control of members is possible. (If there are multiple references, and one attribute needs to change the type, then you can only change the implementation inside, without changing the application one by one. You can also limit the scope of the data)
4. Hide information and implementation details . (Do not implement the interface)


refer to the original text: http://blog.csdn.net/chenssy/article/details/12757911

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326975625&siteId=291194637