----
class Color
{
public:
  String color_;   //Non-Compliant
  String getColor();
  String setcolor();

private:
  String color_;    //Compliant
};
----

By using private attributes and accessor methods (set and get), it prevent from unauthorized modifications of the attributes


The usage of public attributes is not in agreement with the principles of object programming: data encapsulation.


ifdef::env-github,rspecator-view[]
'''
== Comments And Links
(visible only on this page)

include::comments-and-links.adoc[]
endif::env-github,rspecator-view[]
