Learn Java Programming - Static Nested Classes Tutorial

Published: 13 January 2016
on channel: 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.


On this page of the site you can watch the video online Learn Java Programming - Static Nested Classes Tutorial with a duration of hours minute second in good quality, which was uploaded by the user Daniel Ross 13 January 2016, share the link with friends and acquaintances, this video has already been watched 5,134 times on youtube and it was liked by 64 viewers. Enjoy your viewing!