Ask your own question, for FREE!
Computer Science 12 Online
OpenStudy (anonymous):

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

OpenStudy (anonymous):

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

OpenStudy (anoop27):

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

OpenStudy (anonymous):

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

OpenStudy (anonymous):

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

OpenStudy (anonymous):

@akhaliq You can have private static methods too.

OpenStudy (anonymous):

true

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!