Fandom

Wikianswers

Welcome! Enter your question below. Please use words like "Who, What, Where, When, Why, How, etc..." in your question. Nothing to ask? Click here for a random, un-answered question.

When use static in java?

1,033,278questions on
Wikianswers
Add New Page
Talk0 Share

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.

Static is a keyword used to show that something (could be a method or a variable) is associated with the class rather than a particular object.

So one use could be to count how many objects have been created using a static variable. if you used a normal variable it wouldn't work as each object would create its own copy of the variable.

Also on Fandom

Random Wiki