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
Which number is denoted by leading 0x or 0x in java?
Differentiate between postfix and prefix operators in java.
What is array class in java?
How do you access command-line arguments within the code?
What are the advantages of encapsulation in java?
What are the steps involved to create a bean?
What is the use of arraylist in java?
Can we use synchronized block for primitives?
What is tree node in java?
What do you mean by platform independence? What is an interface?
Why we use protected in java?
Explain why wait(), notify() and notifyall() methods are in object class rather than in thread class?
Define inheritance?
What is the difference between jvm and jre? What is an interface?
What do you mean by default constructor in java?