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

Answer Posted / pravallika

in case of static variables memory can be allocated only at once and these variables can access with help of class name but where as non static variables have memory can be allocated in separate locations.And these variables can access with help of object

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What data type is a string?

513


what is interface in java? Explain

532


What is jvm? How its run?

659


What are the types of sockets in java?

540


What do you mean by buffering?

552






what is the role of xml in core java?? and how we can use it?? can somebody give a sample program with explanation and from where i can read more about xml?????

1801


What is the file type?

557


What is "this" keyword in java? Explain

660


What is length in java?

570


Explain, java is compatible with all servers but not all browsers?

611


Why stringbuilder is not thread safe?

542


Which of the classes will have more memory allocated?

538


How do you define a singleton class?

507


Can you add null to a list java?

585


Is arraylist ordered in java?

572