What are the modifiers that are available in Kotlin?

devquora
devquora

Posted On: Feb 22, 2018

 

Access modifier in Kotlin provides the developer to customize the declarations as per the requirements. Kotlin provides four modifiers. They are:
Private: This makes the declaration visible only inside the file containing a declaration.

Public: It is by default, which means that the declarations will be visible everywhere.

Internal: This makes the declaration visible everywhere in the same modules.

Protected: This keeps the declaration protected and is not available for top-level declarations.

    Related Questions

    Please Login or Register to leave a response.

    Related Questions

    Kotlin Interview Questions

    Which type of Programming does Kotlin support?

    Which type of Programming does Kotlin support?..