Answer Posted / ali
No Static Variable cannot declare in method.
but the method present in class can access the static variable
of class.
Or the method which is trying to access the static variable of
class but method is not part of that class at that time declare method as static then it can access that static variable.
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
What steps are taken when the OS shifts from one-thread execution to another?
What is the role of garbage collector in java?
Can a constructor be protected?
Explain the public class modifier?
Is singleton a bad practice?
Is it necessary that each try block must be followed by a catch block?
Why can't you declare a class as protected?
When should the method invokelater() be used?
What is java literals?
Is 64bit faster than 32 bit?
What is math in java?
Explain restrictions for using anonymous inner classes?
What is the effect of keeping a constructor private?
What is Applet Stub Interface ?
What is a bubble sort in java?