| **Navigation:**  [[introduction.htm|Language Reference]] > 5 - Declaration Attributes > Variable and Entity Attributes >====== PRIVATE (set variable private to a CLASS module) ====== | [[primary set relational primary key .htm|{{btn_prev_n.gif|Previous page}}]][[introduction.htm|{{btn_home_n.gif|Return to chapter overview}}]][[protected set variable private to a class or derived class .htm|{{btn_next_n.gif|Next page}}]] | | || **PRIVATE** {{blk2blue.jpg|blk2blue.jpg}} The **PRIVATE** attribute specifies that the variable on which it is placed is visible only to the PROCEDUREs defined within the source module containing the methods of the CLASS structure (whether members of the CLASS or not). This encapsulates the data from other CLASSes. PRIVATE is also valid when used with static (threaded or non-threaded) variables outside of a CLASS structure. If a static variable is declared with the PRIVATE attribute, the compiler generates it without a public external name. Hence, it can only be used by procedures defined in the same source module. The PRIVATE attribute is also allowed for TYPE declarations. **Example:** **OneClass  CLASS,MODULE('OneClass.CLW'),TYPE ** **PublicVar   LONG               !Declare a Public variable** **PrivateVar  LONG,****PRIVATE****       !Declare a Private variable** **BaseProc   PROCEDURE(REAL Parm)!Declare a Public method** **          END** **TwoClass  OneClass             !Instance of OneClass** ** CODE** ** TwoClass.PublicVar = 1        !Legal assignment** ** TwoClass.PrivateVar = 1       !Illegal assignment** **!OneClass.CLW contains:** ** MEMBER()** ** MAP** **SomeLocalProc  PROCEDURE ** ** END** **OneClass.BaseProc  PROCEDURE(REAL Parm)** ** CODE** ** SELF.PrivateVar = Parm        !Legal assignment** **SomeLocalProc  PROCEDURE ** ** CODE ** ** TwoClass.PrivateVar = 1       !Legal assignment** **See Also:** [[class object declaration .htm|CLASS]] [[protected set procedure private to a class or derived class .htm|PROTECTED]]