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 the static import?
What is the difference between abstraction and encapsulation?
Can we create more than one object singleton class?
Do we have pointers in java?
What is the life cycle of Thread ?
12 Answers HCL, Varnar Softech,
What is null object in java?
What do you understand by java?
What is the main method java?
What is non static block in java
10 Answers Emphasis, Ness Technologies,
What is the difference between parameters and arguments ?
What is a resource leak ?
When do we use synchronized methods in java?