File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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 Java Interview Guide 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

static variable inside static function

Ranch Hand

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

Joined: Jan 30, 2000
Posts: 3226
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
I agree. Here's the link:
subject: static variable inside static function
It's not a secret anymore!