File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java 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 » Beginning Java
Bookmark "static variables" Watch "static variables" New topic
Author

static variables

Rajiv Chelsea
Ranch Hand

Joined: Jun 15, 2010
Posts: 88
Are static variables implicitly final or we have to mark them as final?
Pramod P Deore
Ranch Hand

Joined: Jul 15, 2008
Posts: 629

Are static variables implicitly final or we have to mark them as final?


No they are not,we have to mark them final.


Life is easy because we write the source code.....
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

You could have just tried assigning to one. It would have been quicker.
Abimaran Kugathasan
Ranch Hand

Joined: Nov 04, 2009
Posts: 2066

Rajiv Chelsea wrote:Are static variables implicitly final or we have to mark them as final?


static variables are like instance variables, if you don't initialize explicitly, they will get default value, but for the final you have to explicitly initialize them with a value!


|BSc in Electronic Eng| |SCJP 6.0 91%| |SCWCD 5 92%|
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: static variables