Answer Posted / murali
No, Static variables can be declared as a class attributes,
for example,
public classA{
static String m2="xyz"; // this is correct form
public static void main(String args[]){
static String m1="abc"; // this gives an error
(illegal modifier for parameter;;....)
}
}
| Is This Answer Correct ? | 25 Yes | 0 No |
Post New Answer View All Answers
What does java stand for?
Can we override the static methods?
What is the technique adopted to create an immutable class?
What is an anonymous class in java?
Difference between linkedlist and arraylist.
What is boolean false?
Why do we need data structure in java?
what are different ways in which a thread can enter the waiting state? : Java thread
What do negative exponents mean?
What is array class in java?
When wait(), notify(), notifyall() methods are called does it releases the lock or holds the acquired lock?
What is the association?
What are the methods available in a class?
Is java 9 released?
How many types of voids are there?