Answer Posted / aravinda reddy
No we can't declare a static variable in a method or static
method, static variables are class level variables. Static
means one per class as per OO rules and method level
variables scope is with in the method. So if java allows
static variable inside a method, static concept is useless.
| Is This Answer Correct ? | 8 Yes | 0 No |
Post New Answer View All Answers
When will you define a method as static?
List implementations of list interface?
How do you sort words in java?
Why singleton pattern is better than creating singleton class with static instance?
Can I learn java in 3 months?
What is the use of object and class classes?
Which object oriented concept is achieved by using overloading and overriding?
Why packages are used?
why would you use a synchronized block vs. Synchronized method? : Java thread
What does I ++ mean?
Why deletion in linkedlist is fast than arraylist?
What is the super void?
What is field name?
Give any two differences between C++ and java.
What is replacefirst in java?