About 13,700,000 results
Open links in new tab
  1. java - What does the 'static' keyword do in a class? - Stack Overflow

    Since static methods also do not belong to a specific instance, they can't refer to instance members. In the example given, main does not know which instance of the Hello class (and …

  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. java - When to use static methods - Stack Overflow

    Mar 6, 2017 · I am wondering when to use static methods? Say if I have a class with a few getters and setters, a method or two, and I want those methods only to be invokable on an instance …

  4. java - What is the difference between a static method and a non …

    A static method belongs to the class itself and a non-static (aka instance) method belongs to each object that is generated from that class. If your method does something that doesn't depend …

  5. java - What does the "static" modifier after "import" mean? - Stack ...

    Oct 2, 2008 · The static modifier after import is for retrieving/using static fields of a class. One area in which I use import static is for retrieving constants from a class.

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

    Is there anything like static class in Java? What is the meaning of such a class? Do all the methods of the static class need to be static too? Is it required the other way round as well? …

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

    May 27, 2009 · The main method must be static, which means that applications run in a static context by default. One of the basic rules of working with static methods is that you can’t …

  8. java - Difference between Static methods and Instance methods

    In short, static methods and static variables are class level where as instance methods and instance variables are instance or object level. This means whenever a instance or object …

  9. Why is the Java main method static? - Stack Overflow

    Sep 29, 2008 · The main method is static to give the Java VM interpreter a way to start the class without creating an instance of the control class first. Instances of the control class are created …

  10. 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 …