- 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.
推薦閱讀
- ServiceNow Application Development
- 程序員修煉之道:程序設(shè)計入門30講
- Power Up Your PowToon Studio Project
- Raspberry Pi Networking Cookbook(Second Edition)
- PHP程序設(shè)計(慕課版)
- RTC程序設(shè)計:實時音視頻權(quán)威指南
- Processing互動編程藝術(shù)
- Data Analysis with Stata
- Android Wear Projects
- Create React App 2 Quick Start Guide
- HTML+CSS+JavaScript網(wǎng)頁設(shè)計從入門到精通 (清華社"視頻大講堂"大系·網(wǎng)絡(luò)開發(fā)視頻大講堂)
- Unity 2018 Augmented Reality Projects
- Orchestrating Docker
- JQuery風(fēng)暴:完美用戶體驗
- Greenplum構(gòu)建實時數(shù)據(jù)倉庫實踐