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 |
How do you define a set in java?
How to overcome the exception object reference not set to an instance of object?
Why does java not support operator overloading?
What are keywords give examples?
Can we write method inside a method in java?
Can an exception be rethrown?
When is an object in the mean to garbage collection?
What is cloneable interface?
Which is faster call by value or call by reference?
How many types of thread in java? give the name
Can inner class extend any class?
What is synchronization? How it can be achieved?