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


Win a copy of Soft Skills this week in the Jobs Discussion 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
 
Consider Paul's rocket mass heater.
 
subject: static variable inside static function