Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing

Kl0ze

  • 3 years ago

Generally, what is the difference between static and non static? Specifically, what is the difference between static methods and non-static methods?

  • This Question is Closed
  1. valmach
    • 3 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    Static.. permanent .. not static.. is not set in stone.. as applied to what exactly?

  2. anoop27
    • 3 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    Static=fixed(that never changes) example=person Name,Date of birth Non-Static= not fixed example=Age,Address etc.

  3. WhoElseButMe
    • 3 years ago
    Best Response
    You've already chosen the best response.
    Medals 1

    non static must be instantiated first MyClass mc = new MyClass(); now you can use MyClass(). static doesn't require instantiating the object first. But keep in mind a static method can't access instance methods or variables of the class. MyClass.DoWork(); where do work is a static method found inside MyClass().

  4. akhaliq99
    • 3 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    Static is shared across classes, you dont have to create instances for each class

  5. WhoElseButMe
    • 3 years ago
    Best Response
    You've already chosen the best response.
    Medals 1

    @akhaliq You can have private static methods too.

  6. akhaliq99
    • 3 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    true

  7. Not the answer you are looking for?
    Search for more explanations.

    • Attachments:

Ask your own question

Sign Up
Find more explanations on OpenStudy
Privacy Policy