What is the difference between static and non-static
variables?

Answer Posted / javeed

* Non-static which ia(instence variable) can be accessed
only inside a non-sattic method.

* A static variable can be axxessed in both static and non-
static methods.

Is This Answer Correct ?    8 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do you calculate roots in java?

525


What is a stringbuilder?

513


Difference between a process and a program?

615


Tell us something about different types of casting?

519


Can we have a try block without catch block?

569






Whats the difference between notify() and notifyall()?

572


Which is better stringbuilder or stringbuffer?

526


Can we use string in switch case in java?

570


What is boolean in java?

511


What are the drawbacks for singleton class?

520


How will you get the platform dependent values like line separator, path separator, etc., ?

583


Give any two differences between C++ and java.

560


Is arraylist a class in java?

536


What is double word?

533


What happens if I remove static from main method?

523