Classes, objects, interfaces, constructors, and functions, as well as properties and their setters, can have visibility modifiers. Getters always have the same visibility as their properties.
Lets see the different visibility in terms of Packages, Classes & Constructors
Local variables, functions, and classes can't have visibility modifiers.
By default visibility is public in kotlin. Class, function everything.
internal behaves like public but within a module.
private is used within file only at top level declaration and within a class when used with class members
protected can not be used with top level variable or function.
it is available in subclass when used with class member