why we cannot declare static variable inside a static method
Answer Posted / sachin kanojiya
Static variable initializes at the time of class load
(static variable initialize very first,after that static
method)that means static variable and method already define
but inside the static method can't declare static variable
because it is treat as static local member...
| Is This Answer Correct ? | 5 Yes | 4 No |
Post New Answer View All Answers
What is difference between ++ I and I ++ in java?
Difference between string, string builder, and string buffer?
How is a variable stored in memory?
What do you know about the garbage collector in java?
What is string variable?
Explain the available thread states in a high-level?
What is unmodifiable list in java?
What is the platform?
Is vector thread safe in java?
What does split function do in java?
What do you mean by scope of variable?
Can a class be protected in java?
Is 0 true or is 1 true?
Given a singly linked list, find the middle of the list in a single traversal without using temporary variable.
Is set sorted in java?