what is different between static and non static methods ,using
example
Answers were Sorted based on User's Feedback
Answer / siva
we should create object form calling Non static method but
no necessary to create object for calling static method
using class name we call static method
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / guest
Static:
we dont have to create instance of an object
Staic methods cannot access nonstatic methods.
same with variable static variables cannot access static
variables
Non-Static:
we have to create instance of an object
nonStaic methos canaccess nonstatic methods.
same with variable nonstatic variables can access static
variables
| Is This Answer Correct ? | 0 Yes | 1 No |
What is printwriter in java?
Which is the best way to use for String concatenation in Java?
What are the changes in java.io in java 8 ?
What about anonymous inner classes in java?
Is oracle java 11 free?
Why destructor is not used in java?
Can a class have an interface?
What is the difference between class & structure?
Can we create object of static class?
What are the benefits of operations?
what are the differences between final,finally,finalize methods?
What is the difference(or similarity if there are some) between object and a variable?