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 difference between static method and instance method in Java?
What is vector?
how does multithreading take place on a computer with a single cpu? : Java thread
What is the meaning of nullable?
What are the different types of multitasking?
Can we declare a constructor as final?
What is finalize() function in java?
what is the role of xml in core java?? and how we can use it?? can somebody give a sample program with explanation and from where i can read more about xml?????
What are the drawbacks of reflection?
What is the right data type to represent a price in java?
Can you instantiate the math class in Java?
Why java is call by value?
What is an object's lock and which object's have locks in java programming?
How is the marker interface used in Java?
What is the difference between final, finally and finalize()?