internal 模块内可见

    成员默认是public

    1. class House
    2. class Flower
    3. class Countyard{
    4. private val house: House = House()
    5. private val flower: Flower = Flower()
    6. }
    7. class ForbiddenCity{
    8. internal val houses = arrayOf(House(), House())
    9. val flowers = arrayOf(Flower(), Flower())
    10. }
    11. fun main(args: Array<String>) {
    12. val countyard = Countyard()
    13. val fc = ForbiddenCity()
    14. println(fc.flowers)
    15. }