wood burning stoves 2.0*
The moose likes Java in General and the fly likes static variables Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "static variables" Watch "static variables" New topic
Author

static variables

S Babs
Greenhorn

Joined: Apr 16, 2003
Posts: 18
Can i use static variables in Abstract classes and how it will be useful to me
Gayathri Prasad
Ranch Hand

Joined: Jun 25, 2003
Posts: 116
Hi,
We can use the staic variables and static methods in the abstract class just like how we use them in normal classes the normal restrictions hold good and they are
1. They can only call other static methods (in case of static methods)
2.The static methods can only access the static data
3. They cannot refer "this" or "super" in any way.
The abstract classes are always extended and the static methods and static variables are used to make the method or variable common to all the objects and they are class but not object dependent.
Cheers,
Gaya3
-------------------------------------------------
Beginning is half done
Gayathri Prasad
Ranch Hand

Joined: Jun 25, 2003
Posts: 116
Hi,
We can use the staic variables and static methods in the abstract class just like how we use them in normal classes the normal restrictions hold good and they are
1. They can only call other static methods (in case of static methods)
2.The static methods can only access the static data
3. They cannot refer "this" or "super" in any way.
The abstract classes are always extended and the static methods and static variables are used to make the method or variable common to all the objects and they are class but not object dependent.
Cheers,
Gaya3
-------------------------------------------------
Beginning is half done
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: static variables