The local inner class is one of the four nested classes that I briefly discussed in my Introduction to Nested Classes tutorial. A local inner class, aka method-local inner class is defined inside of a method.
class Standard {
String instanceVar = "";
void methodName(String params) {
String s = "";
class LocalInner {
int i = 0;
}
}
}
The first thing to understand about a local inner class is that it can only be instantiated from within the method that it is contained in. You cannot create an instance of the class anywhere else.
On this page of the site you can watch the video online Learn Java Programming - Local Inner Class Tutorial with a duration of hours minute second in good quality, which was uploaded by the user Daniel Ross 11 January 2016, share the link with friends and acquaintances, this video has already been watched 2,074 times on youtube and it was liked by 23 viewers. Enjoy your viewing!