Learn Java Programming - Static Nested Classes Tutorial

Publié le: 13 janvier 2016
sur la chaîne: Daniel Ross
5,134
64

The static nested class is one of the four nested classes that I briefly discussed in my Introduction to Nested Classes tutorial. A static nested class is defined at the member level and must have the keyword static in the declaration.
class Standard {
String s = "";
static class StaticNested {
int i = 0;
}
}
The first thing to understand about an nested static class is that you do not need an instance of either the outer class or the nested static class in order to access its members. You can directly access static methods and variables without creating an object. If you would like to create an instance of a nested static class you do not need an instance of the outer class in order to do so.


Sur cette page du site, vous pouvez voir la vidéo en ligne Learn Java Programming - Static Nested Classes Tutorial durée heure minute seconde en bonne qualité , qui a été Téléchargé par l'utilisateur Daniel Ross 13 janvier 2016, Partagez le lien avec vos amis et connaissances, sur youtube cette vidéo a déjà été regardée 5,134 fois et il a aimé 64 téléspectateurs. Bon visionnage!