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

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

Can we have multiple catch block for a try block?

592


What does it mean to be immutable?

552


How many digits is int32?

541


What is codebase?

543


What is the difference between a break statement and a continue statement?

603






What does isempty () do in java?

611


Can we override constructors in java?

682


List any five features of java?

572


How to do encapsulation in java?

576


What is keyword in oop?

527


What are the new features in java 8? Explain

563


Difference between stack and queue?

595


Which is better stringbuffer or stringbuilder?

533


What is the basic difference between string and stringbuffer object?

581


Can we increase array size dynamically in java?

517