What is the difference between static and non-static
variables?
Answer Posted / santosh mundhe
Static:1)Memory allocated before creation of object.
2)Gets memory on Global segment.
3)Object can't get copy of static variable, each
object shears static variable from global segment.
4)Static variables are not part ob object.
Non-static:
1)Gets memory on satck segment.
2)Object gets copy of non static variable.
3)Non static variables are part of object.
| Is This Answer Correct ? | 8 Yes | 7 No |
Post New Answer View All Answers
What is the abstraction?
What is the final method?
What is the largest data type in java?
What do you mean by chromounits in java8?
How many bits are used to represent unicode, ascii, utf-16, and utf-8 characters?
What is the syntax and characteristics of a lambda expression? Explain
What is constant in programming?
What is the use of java?
What is the purpose of the main method?
What are anonymous inner classes?
What does += mean in java?
What is the main method java?
Explain restrictions for using anonymous inner classes?
What is abstract class? Explain
What are the advantages of user defined functions?