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

Is static variable stored in heap?

724


How to do encapsulation in java?

838


How do you read and print a string in java?

740


What are the two types of java?

784


Are constructors methods?

793


What are the 5 types of research methods?

886


What do you mean by flow of struts?

1027


Can you explain the usages of class.forname()?

873


why an outer class cannot be declared as private?

3944


what is the difference between thread and runnable types? : Java thread

787


How do you escape in java?

824


What is an object in java and how is it created?

848


Why we do exception handling in java and how many types of exceptions are there?

811


What is the epoch date?

753


What is polymorphism in java? What are the kinds of polymorphism?

830