Synopsis: | Declare members privately |
Language: | Java |
Severity Level: | 3 |
Category: | Design |
Description: |
Class members should be declared privately to make sure data is not directly accessible from outside the class. class Design43 { public string bar; // bad protected string bar2; // bad too private string bar3; // allowed public final static int BAR = 0; // allowed } |