0

I know Java, but new to Kotlin. If anything wrong, please correct me, thanks.

Kotlin use internal, but no package scope. As a programmer, I think package is easier to manage and easier to understand. I think there is some reason Kotlin choose internal instead of package. Could anyone tell me why?

Thank you.

Antony
  • 193
  • 1
  • 1
  • 9
  • I asked similar question https://stackoverflow.com/questions/59158369/how-can-i-open-class-only-to-test-class – Ori Marko Dec 30 '19 at 15:09
  • I will just note that no major "better Java" language took its package visibility: C# has internal like Kotlin (earlier, of course), Scala has nested packages. And even Java 10 effectively changes the meaning of package visibility, if you use modules. Just like checked exceptions (but implementing either Scala's or Kotlin's visibility on JVM takes a lot more effort). – Alexey Romanov Dec 30 '19 at 20:01

0 Answers0