Computer Science, asked by Karisma3958, 1 year ago

Can static variables be called using className.variableName in Java?

Answers

Answered by Anonymous
0

No they can never be called using class name or variable name .

Reason :

A static variable is a variable which is declared by the static keyword .

We cannot use any other keyword to declare the variable .

For example :

static n ;

Here n is a static variable .

A static variable is different from a local variable .

A local variable is limited within two curly braces only .

Similar questions