I'm new to Java and is trying to learn the concept of local class. I'm currently reading the chapter on local class on the Offical Java Documentation Oracle. I have encountered two statements in this chapter that seem to contradict each other. Could someone knowledgeable give me a hand as to which statement is correct? Or they are both correct, its just my understanding of the concept is not there yet.
A local class has access to local variables. However, a local class can only access local variables that are declared final.
Local classes are non-static because they have access to instance members of the enclosing block.
https://docs.oracle.com/javase/tutorial/java/javaOO/localclasses.html