When you declare a variable or a method as static, it belongs to the class, rather than a specific instance . This means that only one instance of a static member exists, even if you create multiple objects of the class, or if you don’t create any.
When you declare a variable or a method as static, it belongs to the class, rather than a specific instance . This means that only one instance of a static member exists, even if you create multiple objects of the class, or if you don’t create any.