About 391,000 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. 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 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.

  5. What does 'public static void' mean in Java? - Stack Overflow

    Mar 5, 2010 · 162 What does public static void mean in Java? I'm in the process of learning. In all the examples in the book I'm working from public static void comes before any method that is …

  6. java - what is the meaning of 'static' in a method header ... - Stack ...

    Mar 9, 2012 · The term static means that the method is available at the Class level, and so does not require that an object is instantiated before it's called. Because writeNumbers was being …

  7. What is the use of a private static variable in Java?

    Sep 2, 2011 · public static or private static variables are often used for constants. For example, many people don't like to "hard-code" constants in their code; they like to make a public static …

  8. How does the "final" keyword in Java work? (I can still modify an ...

    In Java we use final keyword with variables to specify its values are not to be changed. But I see that you can change the value in the constructor / methods of the class.

  9. Are static variables shared between threads? - Stack Overflow

    Jun 20, 2020 · The visibility of non-local variables does not depend on whether they are static variables, object fields or array elements, they all have the same considerations. (With the …

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

    Well, Java has "static nested classes", but they're not at all the same as C#'s static classes, if that's where you were coming from. A static nested class is just one which doesn't implicitly …