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 is final different from finally and finalize?
What are different access specifiers in java? Explain
What is primitive array?
What is a char in java?
What are the main uses of the super keyword?
Can main() method in java can return any data?
Why are variables important in research?
when should you use stringbuilder class in a program?
How many bytes are there?
What is treeset in java collection?
What is passing parameters in java?
If I don't provide any arguments on the command line, then what will the value stored in the string array passed into the main() method, empty or null?
What is the exact difference in between unicast and multicast object? Where we will use?
What are the two environment variables that must be set in order to run any java programs?
What is meant by nested loop?