![]() a, c, d, and e() of the Base class are visible Note: If visibility modifier is not specified, it is public by default.įun function1() // visible to the Base and the Derived class Not available for packages (used for subclasses) ![]() Visible inside the same module (a set of Kotlin files compiled together) Visible inside the file containing the declaration Recommended reading: Kotlin Packages Modifier You will learn about two more visibility modifiers protected and internal (as well as public and private) in detail.Ī package organizes a set of related functions, properties and classes, objects, and interfaces. In Kotlin Class and Objects article, you learned about visibility modifiers public and private in brief. ![]() (You cannot set visibility modifier of getters as they always take the same visibility as that of the property.) Visibility modifiers are keywords that set the visibility (accessibility) of classes, objects, interface, constructors, functions, properties and their setters. ![]()
0 Comments
Leave a Reply. |