A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
OCA/OCP Java SE 7 Programmer I & II Study Guide
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
subject: Static variables
static mathods/variable inheritance
static variables in multithreading
final static variables in beans?
Static variables must store ?
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014