March 2018
Intermediate to advanced
183 pages
2h 34m
English
The static keyword is used to create class members that exist in only one copy, which belongs to the class itself. These members are shared among all instances of the class. This is different from instance (non-static) members, which are created as new copies for each new object.
A static field (class field) cannot be initialized inside the class like an instance field. Instead it must be defined outside of the class declaration. This initialization will take place only once, and the static field will then remain initialized throughout the life of the application.