January 2018
Intermediate to advanced
115 pages
1h 37m
English
The static keyword is used to create fields and methods that can be accessed without having to make an instance of the class. Static (class) members only exist in one copy, which belongs to the class itself, whereas instance (non-static) members are created as new copies for each new object. That means static methods can’t use instance members because these methods aren’t part of an instance. On the other hand, instance methods can use both static and instance members: