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

Answer Posted / ravikiran

static variables are class variables and the values remains
same fr the whole class
nonstatic variables are of two kinds
global variables:are the variables which defines variables
which can be accesible over the whole class
local variables:the scope of local variables is with tin
the method only

Is This Answer Correct ?    29 Yes 15 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is considered an anti pattern?

529


Which of the classes will have more memory allocated?

538


What are strings in physics?

545


What does it mean that a method or field is “static”?

550


Can we declare array without size in java?

549






Is integer a class?

565


what is collatration?

2741


What is internal iteration in java se 8?

627


Can we use a default constructor of a class even if an explicit constructor is defined?

651


What is string in java is it a data type?

535


What is the null?

541


What is a java predicate?

533


what r advatages of websphere? & how to deploy?

1636


What are advantages of using Java?s layout managers than windowing systems?

1859


Is set ordered in java?

572