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

Is java 9 released?

731


What are three ways in which a thread can enter the waiting state in java programming?

908


What is the role of garbage collector in java?

719


What is empty string literal in java?

789


what are synchronized methods and synchronized statements? : Java thread

779


How to print an arraylist in java?

751


What is an abstract method in java programming?

799


What is array and arraylist in java?

777


What are recursive functions?

798


Why does abstract class have constructor?

763


What is classes in java?

708


How the metacharacters are different from the ordinary characters?

777


Which is better stringbuilder or stringbuffer?

709


What is navigable map in java?

737


What is loop in java?

752