In this tutorial you will learn about the Kotlin Visibility Modifiers and its application with practical example.
Kotlin Visibility Modifiers
Visibility Modifiers: Kotlin provides a number of Visibility Modifiers that can be used in classes, objects, properties, member function etc. In Above example I have used private visibility modifiers for isActive Property , it means it can use only within the class.
Table Of Contents−
There are four visibility modifiers that are:
1.private: This modifiers can access or visible only inside the class.
2.public: This modifiers can access or visible everywhere.
3.protected: This modifiers can access or visible to the class and its subclass.
4.internal: It is accessble inside the module.