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 we make constructors static?
What is a programming object?
How to sort double array in java?
How many boolean functions are there?
Name and explain the types of ways which are used to pass arguments in any function in java.
What are parsers? Dom vs sax parser.
How can we create a thread in java?
How do you remove spaces in java?
How is a variable stored in memory?
Explain java heap space and garbage collection?
Why java is secure? Explain.
What are local variables?
What is a nested class?
What is jrmp?
What is sorting in java?