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.
Sur cette page du site, vous pouvez voir la vidéo en ligne Learn Java Programming - Local Inner Class Tutorial durée heure minute seconde en bonne qualité , qui a été Téléchargé par l'utilisateur Daniel Ross 11 janvier 2016, Partagez le lien avec vos amis et connaissances, sur youtube cette vidéo a déjà été regardée 2,074 fois et il a aimé 23 téléspectateurs. Bon visionnage!