A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
Java 8 in Action
this week in the
Programmer Certification (SCJP/OCPJP)
Joined: Jul 07, 2003
Aug 12, 2003 11:25:00
Are variables declared in static methods static by default?
Joined: Jun 02, 2003
Aug 12, 2003 11:38:00
No, the variables in a static method cannot be static by default;they have to be declared explicitly static.By default, they r non-static
Joined: Jun 13, 2000
Aug 12, 2003 12:15:00
Variables declared in a method are neither static (Class Variables) or non-static (Instance Variables) they are Automatic Variables (or Local Variables) and as such are not part of the state of an Object which is they only way static and non-static have any context.
I Hope This Helps
Carl Trusiak, SCJP2, SCWCD
Did you see how Paul
cut 87% off of his electric heat bill with 82 watts of micro heaters
subject: Static variables
static mathods/variable inheritance
Static variables must store ?
final static variables in beans?
static variables in multithreading
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014