Visibility Modifiers

suggest change

Introduction

Kotlin has four visibility modifiers.

Public: visible from anywhere. This is the default.

Private: visible only inside the declaring class, or inside the file for a top-level declaration.

Protected: visible inside the declaring class and its subclasses. Not allowed on top-level declarations.

Internal: visible anywhere in the same module.

Syntax

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents