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
Why singleton pattern is better than creating singleton class with static instance?
Difference between throw and throws?
Why do we need data serialization?
what do you mean by marker interface in java?
Write code of any action class?
What are synchronized methods ?
What do you know about the garbage collector?
What is return in java?
What is autoboxing in java?
What is the purpose of main function in java?
Is zero a natural number?
Is array serializable java?
What is externalizable interface?
What is n in java?
What is an interface in java? Explain