Visibility modifiers

 

In Kotlin classes, objects, interfaces, constructors, functions, properties and their setters can have visibility modifiers. Getters always have the same visibility as the property.

 

There are:

 

private - visible only inside the current scope

protected – visible for the current scope and all that extend it

public - visible everywhere

internal – visible everywhere inside the current module

 

The default visibility is public.