1.

What Are The Modifiers That Are Available In Kotlin?

Answer»

The 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 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.

The modifier in Kotlin provides the developer to customize the declarations as per the requirements.

Kotlin provides four modifiers.

They are:



Discussion

No Comment Found