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
What is output buffer?
Are arrays static in java?
What is the purpose of tostring() method in java?
Can you override private or static method in java?
When does an object becomes eligible for garbage collection in java?
What is mvc in java?
What is final, finally, finalize?
What is string and its types?
What is early binding and late binding in java?
Can we overload final method in java?
What is the difference between a synchronized method and a synchronized block?
What is variable and its types?
What are the high-level thread states in java programming?
What do negative exponents mean?
What is the longest unicode character?