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 to display arraylist values in java?
What are the two types of java?
What do you mean by an interface in java?
what is deadlock? : Java thread
What does system.gc() and runtime.gc() methods do?
When do you get classcastexception?
what is difference between class and object?
43 Answers College School Exams Tests, HCL,
What is the difference between yield() and sleep()?
How many types of methods are there?
How many types of classes are there in java?
What code optimizations techniques you follow in general practice?
2 Answers Accenture, TCS, Wipro,
Can we override the overloaded method?