Suppose you're writing an Android project (not a library). All the files are compiled together so... is there any sense to use an internal
visibility modifier in this case?
Suppose you're writing an Android project (not a library). All the files are compiled together so... is there any sense to use an internal
visibility modifier in this case?
You can have multiple Gradle modules that depend on each other within a single Android application, in that case, internal
restricts visibility to within a given module. This could be useful if, for example, you have a separate data
module that handles database and network tasks, and you only want to expose a couple interfaces from that module, but not their implementations.
Otherwise, if you're not using multiple modules, and your entire application is just in the default app
module, then the internal
modifier makes no difference in comparison to the default public
visibility.