What is the difference between static and non-static
variables?
Answer Posted / sandhya reddy
Static Variables are loading when class is loading to the JVM.
Non-Static Variables are loading only when an object is
creating for the particular class.Non- Static variables
can't use inside Static Methods untill and unless creating
an object of that class.with the object reference only we
can asle to use Non-static variables inside Static methods,
But inside Non-Static methods we able to use static
variables without creating any object.
Is This Answer Correct ? | 11 Yes | 6 No |
Post New Answer View All Answers
List types of storage classes in java?
Why vector is used in java?
What is charat ()?
What is argument in java?
What do you know about java?
What is the java reflection api? Why it’s so important to have?
Which is faster call by value or call by reference?
What is a Null object?
How do you differentiate abstract class from interface?
What is the concatenation operator in java?
Can you override a final method?
Can we declare the main method of our class as private?
Difference between predicate, supplier and consumer ?
What is java util hashmap?
Why java is used everywhere?