I assume you already did C / C ++. These inner classes are not Android specific. They come from Java. In Java, the stacks (which we live in C / C ++) do not exist the same. Think of Java byte code as a blob of a binary executable that exists within a single function (sort of writing all your code inside a main function in C / C ++). But Java allows you to be “Object Oriented” and localize your code in classes for different tasks. It also allows you to infer from another class and create it at the same time. This is what you see in all the examples. The link provided by "Macarse" explains this for the Java programmer.
source share