This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes static variable inside static function 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 "static variable inside static function" Watch "static variable inside static function" New topic
Author

static variable inside static function

Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
can i declare static variable inside a static function if not
why?
Tony Alicea
Desperado
Sheriff

Joined: Jan 30, 2000
Posts: 3222
    
    5
No. Methods cannot declare static variables. Any local variables defined inside the static method will be static by context.


Tony Alicea
Senior Java Web Application Developer, SCPJ2, SCWCD
 
wood burning stoves
 
subject: static variable inside static function
 
Similar Threads
static variable inside function definition
static variable in method
Initializing final arguments
Static Main function VS Static user define function
Strings information required