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
How do you access command-line arguments within the code?
Explain the init method?
Is set thread safe java?
What does substring mean?
What is executor memory?
What is the final method?
If two threads have same priority which thread will be executed first ?
Write a program to find the whether a number is an Armstrong number or not?
What are selection structures?
What are the types of inner classes (non-static nested class) used in java?
What will happen if there is a default method conflict as mentioned above and we have specified the same signature method in the base class instead of overriding in the existing class ?
What is method in java ?
Explain the difference between transient and volatile in java?
Explain java coding standards for variables ?
What does localhost mean?