static
6 tutorials tagged “static”.
- Blank Final and Static Final VariablesFinal variables declared without a value: blank finals set in every constructor, blank static finals set in a static block, and the compile errors.
- Instance Variable vs Static VariableInstance variables vs static variables side by side: one per object vs one per class, where each lives, when each is created, default values, and how to choose.
- Can Static, Private and Final Methods Be OverriddenWhy static, private and final methods can't be overridden, what method hiding is, and why fields follow the variable's type instead of the object.
- Static BlockCode that runs once when a class is initialized: static block syntax, setting up static data, when classes are initialized, and failures.
- Java Static KeywordWhat static means for variables, methods, blocks and imports: one copy per class, calling without an object, and what static code can't touch.
- Static Methods vs Instance MethodsStatic methods, called on the class, vs instance methods, called on an object: what each can access, when to use which, and the static context error.