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
When should you use arraylist and when should you use linkedlist?
Why strings in java are called as immutable?
Can a class be a super class and a sub-class at the same time? Give example.
Can we restart a thread already started in java?
If you do not want your class to be inherited by any other class. What would you do?
What is parameter example?
What are the changes in java.io in java 8 ?
What does sizeof return?
Why is java not 100% pure oops?
Is array an object in java?
Can we sort array in java?
What is bool mean?
What is the difference between jdk, jre, and jvm?
Can a java program have 2 main methods?
Explain the importance of import keyword in java?