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 are the operands of instanceof operator?

3 Answers  


what is the main class of all the classes

5 Answers   Photon,


What is I/O Filter?

2 Answers   TCS, WAX,


How to perform Singleton of the java class object on multi JVM?

2 Answers  


In which order the iterator iterates over collection?

0 Answers  






How do you square a number?

0 Answers  


explain the classification of exception and hoew to handle the exceptions

2 Answers  


What is an immutable object?

0 Answers  


what is the use/perpose of having a method antive?

2 Answers  


What is lambda expression in java?

0 Answers  


what do you mean by java annotations?

0 Answers  


What is the symbol for average?

0 Answers  


Categories