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 static block?
What do you mean by of string::valueof expression in java 8?
What is size () in java?
How do you make a thread in java?
What is the use of parseint in java?
Can a serialized object be transferred via network?
Does list allow duplicates in java?
How do you find the independent variable?
What are the advantages and disadvantages of object cloning?
What is a layout manager and what are different types of layout managers available in java awt?
What is the function of compareto in java?
What does yield method of the thread class do?
What is difference between word and integer?
What is final int?
Explain about arraylist?