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 is the final variable?
What is meant by collection in java?
What is boolean strategy?
What is a java list?
How does enum work in java?
What is the indent key?
Why java is call by value?
Can I override protected method in java?
Is char * a string?
What are user defined exceptions?
What are the difference between composition and inheritance in java?
What is a map in java?
What is preflight request?
What is string pool?
What are the escape sequences in java?