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
how we can create packages in java?
what is server side caching?
What is stringreader?
What is xslt in java?
What is the purpose of garbage collection in java?
How do you sort data in java?
What is the collections api in java programming?
Can there be an abstract method without an abstract class?
What is string literal in java?
Is object a data type in java?
Given a singly linked list, find the middle of the list in a single traversal without using temporary variable.
What is the purpose of using bufferedinputstream and bufferedoutputstream classes?
What is the difference between keyword and identifier?
What is the loop in java?
What are voids?