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
What does void * mean?
What is difference between equals and hashcode method?
What is a blocking method in Java?
Are maps ordered java?
How transient variable is different from volatile variable?
Define interface in java?
What is tcp and udp?
Can we override protected method in java?
Give example to differentiate between call by value and call by reference.
What is the biggest integer?
How do you reverse a string in java without using string buffer?
Do loops java?
Class c implements interface I containing method m1 and m2 declarations. Class c has provided implementation for method m2. Can I create an object of class c?
What are void pointers?
What happens to a static var that is defined within a method of a class?