In programming, "static" refers to a variable or method that belongs to the class itself, rather than an instance of the class. It can be accessed without creating an object of the class.
Think of a static TV channel that you can watch without having to turn on your television. Similarly, a static variable or method is always available and doesn't require an instance of the class.
Instance Variable: A variable that belongs to each individual object created from a class.
Class Method: A method that belongs to the class itself and can be called without creating an object.
Static Block: A block of code in a class that is executed only once when the class is loaded into memory.
© 2024 Fiveable Inc. All rights reserved.
AP® and SAT® are trademarks registered by the College Board, which is not affiliated with, and does not endorse this website.