About 51,100 results
Open links in new tab
  1. What does the 'static' keyword do in a class? - Stack Overflow

    The static keyword in Java means that the variable or function is shared between all instances of that class as it belongs to the type, not the actual objects themselves.

  2. In laymans terms, what does 'static' mean in Java?

    The static keyword can be used in several different ways in Java and in almost all cases it is a modifier which means the thing it is modifying is usable without an enclosing object instance. …

  3. How does the static keyword work in Java? - Stack Overflow

    Oct 28, 2017 · I'm reading Java tutorials from the begining and I have a question about static keyword on fields or variables. As Java said here: Class Variables (Static Fields) A class …

  4. java - When to use static methods - Stack Overflow

    Mar 6, 2017 · In Java, static methods are methods that belong to a class rather than an instance of the class. They are called on the class itself, rather than on an object created from that class.

  5. java - Difference between Static and final? - Stack Overflow

    Dec 8, 2012 · The static keyword can be used in 4 scenarios static variables static methods static blocks of code static nested class Let's look at static variables and static methods first. Static …

  6. Difference between a static and a final static variable in Java

    In Java, a static variable is one that belongs to class rather than the object of a class, different instances of the same class will contain the same static variable value.

  7. java - Why do I need to make a static class to make instances of …

    Feb 28, 2025 · 1 When I'm trying to make instances of my class I get errors unless I add the static keyword. I'm wondering why this is, doesn't this go against the whole concept of being static. …

  8. What is a "static class" in Java? - Stack Overflow

    Java has a rather unique interpretation of the "static" keyword. It looks like OP is coming from C# where "static class" is the equivalent of a singleton in Java.

  9. java - Difference between Static methods and Instance methods

    Difference between Static methods and Instance methods Instance method are methods which require an object of its class to be created before it can be called. Static methods are the …

  10. java - What is "static"? - Stack Overflow

    May 27, 2009 · I hope that some what clarifies what the static modifier is used for. The Java Tutorials from Sun has a section called Understanding Instance and Class Members, which …