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
How can you generate random numbers in java?
How do you compare arrays in java?
Can we call virtual funciton in a constructor ?
What is the purpose of the finalize() method?
Can we override the private methods?
What is a Presistent Object?
Should a main method be compulsorily declared in all java classes?
What is the importance of hashcode() and equals() methods?
What is foreach loop in java?
Difference between string, stringbuffer and stringbuilder?
What is the use of join method?
What is n in java?
What is use of valueof () in java?
What is array sorting in java?
What is the purpose of file class?