what is different between static and non static methods ,using
example

Answers were Sorted based on User's Feedback



what is different between static and non static methods ,using example..

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

what is different between static and non static methods ,using example..

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

Post New Answer

More Core Java Interview Questions

What is the static import?

0 Answers  


What is the difference between abstraction and encapsulation?

0 Answers  


Can we create more than one object singleton class?

0 Answers  


Do we have pointers in java?

0 Answers  


What is the life cycle of Thread ?

12 Answers   HCL, Varnar Softech,






What is null object in java?

0 Answers  


What do you understand by java?

0 Answers  


What is the main method java?

0 Answers  


What is non static block in java

10 Answers   Emphasis, Ness Technologies,


What is the difference between parameters and arguments ?

2 Answers  


What is a resource leak ?

1 Answers  


When do we use synchronized methods in java?

0 Answers  


Categories