by Dinesh Thakur Category: Object-oriented programming (OOP)

Inside our class, we define variables, which are the properties of the class. We could declare all the variables as Public so that all other project code could set and retrieve their values.

 

However, this approach violates the rules of encapsulation that require each object to in charge of its own data. Encapsulation is also called data hiding. To accomplish encapsulation, we will declare all variables in a class module as Private.

When our program creates object from our class, we will need to assign values to the properties. Because the properties are private variables, we will use special property procedures to pass the values to the class module and to return values from the class module.

 

 



About Dinesh Thakur

Dinesh ThakurDinesh Thakur holds an B.SC (Computer Science), MCSE, MCDBA, CCNA, CCNP, A+, SCJP certifications. Dinesh authors the hugely popular blog. Where he writes how-to guides around Computer fundamental , computer software, Computer programming, and web apps. For any type of query or something that you think is missing, please feel free to Contact us.