- Learn Kotlin Programming(Second Edition)
- Stephen Samuel Stefan Bocutiu
- 104字
- 2021-06-24 14:13:28
Visibility modifiers
Usually, not all functions or classes are designed to be part of your public API. Therefore, it is desirable to mark some parts of your code as internal and not accessible outside of the class or package. The keywords that are used to specify this are called visibility modifiers.
There are four visibility modifiers—public, internal, protected, and private. If no modifier is given, then the default is used, which is public. This means they are fully visible to any code that wishes to use them.
Java developers will know that this contrasts to the Java default, which has package-level visibility.
推薦閱讀
- Oracle從入門到精通(第3版)
- Instant Apache Stanbol
- Python自動化運維快速入門
- Internet of Things with Intel Galileo
- Java軟件開發基礎
- Python漫游數學王國:高等數學、線性代數、數理統計及運籌學
- Python深度學習:基于TensorFlow
- Python算法指南:程序員經典算法分析與實現
- Mastering Business Intelligence with MicroStrategy
- Practical Game Design with Unity and Playmaker
- Python開發基礎
- 遠方:兩位持續創業者的點滴思考
- Python Digital Forensics Cookbook
- 虛擬現實建模與編程(SketchUp+OSG開發技術)
- Java EE 程序設計