The overview of @Pagotti's answer is right, if done right. However, their classes are not static. If it is not static, it is instance. Do you know what happens when something is instance? It needs to save the reference to the original instance.
How can I prove that it is an instance? In the inner classes, you can do FragmentList.this
, which returns the reference to the FragmentList
object that instantiated the class, for example, EquipeList
.
Internally, how does it work? All built-in class constructors get one more argument 1 , FragmentList.this
. Therefore, creating an object from an "instance" class imposes a more argument on the stack than a normal self-contained class constructor. It also has the question that each object will make one more reference, so there will be one more field inside each object.
What is the real impact of this? Just by measuring, I think it's next to nothing for normal applications. Note that games are not normal applications . A game needs to be optimized so the user does not have the perception of framemiss . That means you only have 16ms between two frames to render everything and provide a new screen (valid time for Android, I do not remember on other platforms). But is not usually this bit brushing that you can give the required performance.