Posted On: Jun 24, 2024
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.
Never Miss an Articles from us.
Kotlin is an open-source language combining object-oriented programming features. Notable features include range expressions, extension functions, companion objects, smart casts, and data classes, off..
Kotlin supports OOP with classes and objects, FP with higher-order functions and immutability, and procedural programming for sequential execution, catering to diverse software development approaches...