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 anagram of a string?

527


What is immutable data?

592


What is the difference between synchronized and synchronized block?

512


Convert a BST into a DLL and DLL to BST in place.

682


How do you calculate square roots?

588






What is the use of conditional statement?

572


What do bitwise operators do?

537


What is the file type?

569


What is the purpose of default constructor?

593


Can an interface have a class?

575


What are the topics in advance java?

535


How is a variable stored in memory?

544


What is the use of arraylist class in java?

570


How objects are stored in java?

554


What is meant by singleton class?

612