private Summary The private keyword modifies access. The private access level is the least permissive. If a member is declared private, it can only be accessed from within the class (including inner/nested classes) or module it was declared. Syntax private member Parameters member The member to make 'private'. Description The private keyword is an access modifier. It is used to change the visibility and access privilege for a member to the least permissive level. For classes, if a class member is declared private, it can only be accessed from within the class it was declared (including inner/nested classes). For modules, if a module member is declared private, it can only be accessed from within the module it was declared. Examples Private Field 1234class Foo{ private int bar = 1;} Private Method 1234567class Foo{ private int bar() { return 1; }} Private Submodule 123456module Foo{ private module Bar { }} See Also class module Share HTML | BBCode | Direct Link