About 229,000 results
Open links in new tab
  1. 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 …

  2. java - What is the difference between a static and a non-static ...

    The static initializer is actually invoked later, when the class is initialized, after it has been loaded and linked. That happens when you instantiate an object of a class or access a static variable …

  3. Are Java static calls more or less expensive than non-static calls?

    Sep 27, 2010 · Third: much of the mythos surrounding static versus non-static are based either on very old JVMs (which did not do anywhere near the optimization that Hotspot does), or some …

  4. java - static vs non static - Stack Overflow

    Dec 15, 2013 · Until few weeks back, I thought I understand when to make fields and methods static or non-static. For example, when a field (say object of another class) is unique for any …

  5. Java: Static vs inner class - Stack Overflow

    Mar 4, 2019 · A non-static nested class has full access to the members of the class within which it is nested. A static nested class does not have a reference to a nesting instance, so a static …

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

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

  8. java - static variable vs non static variable - Stack Overflow

    static is a class level variable and non static is an instance variable (object level variable) . So here you declare only static variable and call them different way but same meaning.

  9. java - When would I want to make my private class static ... - Stack ...

    Mar 26, 2014 · Moreover, if you want to access from inside B a non-static field of A, then you can't have B as private static class. I generally prefer private static class, except when i cant use it …

  10. Java inner class and static nested class - Stack Overflow

    Sep 16, 2008 · What is the main difference between an inner class and a static nested class in Java? Does design / implementation play a role in choosing one of these?