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

Answer Posted / sathya

Static variables:
There is only one copy of static variable and even
when the class is instatiated, the value remains the same.

Non-static variables:
Every time the class is instatiated, the objest has
their own copy of these variables.

Is This Answer Correct ?    72 Yes 13 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What does isempty () do in java?

826


Why wait and notify methods are declared in object class?

818


What is appletviewer?

820


what is meant by Garbage collection?

849


what is the difference between future and callable interface in java?

892


How many times finalize method will be invoked? Who invokes finalize() method in java?

800


Can we serialize singleton class?

792


How do I stop concurrentmodificationexception?

753


How to create a base64 decoder in java8?

809


Explain Basics of OOP Language in java

821


What is the purpose of javac exe?

799


Is null false in java?

964


What are the advantages of arraylist over arrays?

822


What are 5 boolean operators?

850


What is the difference between == and === javascript?

825