*
The moose likes Beginning Java and the fly likes is a static final variable a class variable?? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "is a static final variable a class variable?? " Watch "is a static final variable a class variable?? " New topic
Author

is a static final variable a class variable??

yuvraj kotegar
Ranch Hand

Joined: Jul 31, 2008
Posts: 120
example

class Abc {
public static final int BOSS=10;

}

is it a class variable???
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19655
    
  18

Yes it is.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
yuvraj kotegar
Ranch Hand

Joined: Jul 31, 2008
Posts: 120
Thanks Rob for the quick reply.
marc weber
Sheriff

Joined: Aug 31, 2004
Posts: 11343

But do you see why it's a class variable?


"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
sscce.org
chander shivdasani
Ranch Hand

Joined: Oct 09, 2007
Posts: 206

The values of Static variables are persistent across all the objects in a particular class. In other words, Only one copy of the variable is maintained for the whole class.

Hence,Static variables are called as Class variables.


Enjoy, Chander
SCJP 5, Oracle Certified PL/SQL Developer
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: is a static final variable a class variable??
 
Similar Threads
inner class and static variables
anyone could explain this?
Why inner class can't have static variable
static and final
system.out.println