I know that encapsulation connects members and their behavior in one object. And that made me think that members should be private. Does this mean if a class with public members does not comply with the 100% encapsulation rule?
thank
Encapsulation is a collection of data and hiding data. Java allows you to provide data, but you must have a very good reason if you decide to do so. Member variables should be private by default and only increase to higher visibility if absolutely necessary.
, ( ) getter, seters, property .. , java (getters seters),.net() .. - .
, ? , . , , 1 10. , , . , , int, , , "", .
!
. / , .
- , , , . , setter .
Source: https://habr.com/ru/post/1745169/More articles:iphone SDK: UIView dealloc not called. What for? - memory-managementПолиморфные модели хакеров - ruby-on-railsTesting a method sending email without sending mail - c #C ++ is like a stream parameter, variables are not available - c ++Although not required [required], the list box is displayed as needed, and the state of the model is not valid because it is null? - asp.net-mvcHow to profile and capture double deletion and memory corruption in C ++ - c ++How do I see ** all ** current defined variables in PHP? - debuggingCSS selector for the last occurrence of the class on the page - cssAdd custom field key to functions.php - phpMonotouch Classes - c #All Articles