aspose file tools*
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
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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: static variable inside static function