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 java strings are immutable in nature?
What does provide mean construction?
What is the main function in java?
How do you represent a space in regex java?
What is the synchronized method modifier?
Explain methods specific to list interface?
State the difference between creating string as new () and literal.
which one is more efficient int x; 1. if(x==null) 2.if(null==x) state which one either 1 or 2?
Why do we create threads in java?
what is the difference between process and thread? : Java thread
Which arithmetic operations can result in the throwing of an arithmeticexception?
What are different exception types exceptions available in java ?
Can I uninstall java?
What is balanced tree in java?
What is compareto?