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
Can a static member function access member variable of an object?
What is a key in java?
What are the supported platforms by java programming language?
What is proper subset?
What is mean by collections in java?
Can we create an object if a class doesn't have any constructor ( not even the default provided by constructor ) ?
What is locale?
What will be the default values of all the elements of an array defined as an instance variable?
Is simpledateformat safe to use in the multithreaded program?
what is the use of pojo (plain old java objects)? how it is interact with crystal reports? pls urgent
Are true and false keywords?
Can a static class implement an interface?
What is regex in java?
What are different types of states exist for a thread?
Why unicode is important?