You are mistaken in your understanding, but linter is not particularly clear, and the advice is probably not related to Android (this is not J2ME).
As David explained, the internal implicit default constructor for the inner class has the same access modifier as the class itself, but private members are available in the same compilation unit (Java file). There is no language reason to avoid a private constructor.
However, internally, since classes are compiled into separate output files, the compiler must create synthetic adapter methods to give classes access to private members. The lack of runtime of these methods does not matter for desktop applications, but for something the same as J2ME, the difference can be justified if access to the element will be available directly (using the package area).
Android does significant post-processing of class files, and Android devices are not as limited as J2ME devices. If you do not type code for both platforms, I would change the lint configuration.
chrylis
source share