🐦 Kotlin
Advanced
What is the internal visibility modifier in Kotlin?
Answer
The internal modifier makes a declaration visible within the same compilation module — a module being a set of Kotlin files compiled together (typically a Gradle module). Unlike private (file/class scope) or public (visible everywhere), internal is the ideal visibility for library implementation details. Library code marked internal can be used freely across the library's own modules but is invisible to library consumers who depend on the library from the outside. This enforces a clean public API boundary without making internal helpers private to a single file.
Previous
What is the difference between abstract class and interface in Kotlin?
Next
What is the tailrec modifier in Kotlin?