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 main in java?
What is bool mean?
Which is illegal identifier in java?
Can we declare the static variables and methods in an abstract class?
What is final method?
What is the difference between hashset and treeset in java?
What is the advantage of functional interface in java 8?
What is a method type?
What do you understand by casting in java language?
How do you compare two strings lexicographically?
Write a java program to count the number of words present in a string?
How do you bind variables?
what is function overloading in java?
In the below example, how many string objects are created?
Can we clone singleton object in java?