Saturday, 23 February 2019

Kotlin Visibility Modifier

Kotlin

A).Visibility Modifiers Inside Package:-


  1. Public:- Visible every where.
  2. Private:-Visible inside the file containing the declaration.
  3. Internal:-Visible inside the same package.
  4. Protected:-Not available inside the package.

B).Visibility inside the classes and interface
  1. Public:- Visible to any client who can see the declaring the class.
  2. Private:- Visible inside the class only.
  3. Protected:- Visible inside the class and its sub classes.
  4. Internal:- Visible to any client inside the module that can see the declaring class.