August 2017
Intermediate to advanced
440 pages
10h
English
It is pretty obvious how the public, private, and protected modifiers are compiled to Java, because they have direct analogs. But there is a problem with the internal modifier because it has no direct analog in Java, so there is also no support in Java bytecode. This is why the internal modifier is actually compiled to the public modifier, and to communicate that it shouldn't be used in Java, its name is mashed (changed so that it is not usable anymore). For example, here we have the Foo class:
open class Foo {
internal fun boo() { }
}
It could be possible to use it in Java like this:
public class Java {
void a() {
new Foo().boo$production_sources_for_module_SmallTest();
}
}
Read now
Unlock full access