Quantcast

A community for students. Sign up today!

Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing

Kl0ze

  • one year 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
    • one year 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
    • one year 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
    • one year 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
    • one year 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
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 1

    @akhaliq You can have private static methods too.

  6. akhaliq99
    • one year 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

Ask a Question
Find more explanations on OpenStudy

Your question is ready. Sign up for free to start getting answers.

spraguer (Moderator)
5 → View Detailed Profile

is replying to Can someone tell me what button the professor is hitting...

23

  • Teamwork 19 Teammate
  • Problem Solving 19 Hero
  • You have blocked this person.
  • ✔ You're a fan Checking fan status...

Thanks for being so helpful in mathematics. If you are getting quality help, make sure you spread the word about OpenStudy.

This is the testimonial you wrote.
You haven't written a testimonial for Owlfred.