Static can be used in four ways:staticvariables are shared by the entire class, not a specific instance (unlike normal member variables)staticmethods are also shared by the entire classstaticclasses are inner classes that aren’t tied to their enclosing classesstaticcan be used around a block of code in a class to specify code that runs when the virtual machine is first started up, before instances of the class are created.
No comments:
Post a Comment