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 is a file pointer?

608


Explain why wait(), notify() and notifyall() methods are in object class rather than in thread class?

648


Which class contains a method: cloneable or object?

640


Tell me a few examples of final classes defined in Java API?

649


Difference between string, string builder, and string buffer?

616






What is the difference between synchronized and synchronized block?

612


Java is pass by value or pass by reference? Explain

638


Explain the differences between static and dynamic variables?

690


What is the difference between instanceof and isinstance?

654


What is a protected void?

596


What is arrays aslist in java?

614


What is a string token?

622


How will you print number in reverse (descending) order in BST.

666


what is synchronization and why is it important? : Java thread

703


What is super?

667