This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes static variable in method Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "static variable in method" Watch "static variable in method" New topic
Author

static variable in method

aruna ver
Greenhorn

Joined: Jun 24, 2002
Posts: 8
hi
can we declare static variable inside a method
i tried do that i am getting compilation error
pls can anybody tell me why am i getting compilation error
thanks
arunabhanu
Thomas Paul
mister krabs
Ranch Hand

Joined: May 05, 2000
Posts: 13974
You can not create a static variable inside a method.


Associate Instructor - Hofstra University
Amazon Top 750 reviewer - Blog - Unresolved References - Book Review Blog
Dan Culache
Ranch Hand

Joined: Jan 24, 2003
Posts: 70
The only accepted modifier for local variable is
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: static variable in method
 
Similar Threads
Static method question
Static Variables
Inetaddress - Compilation error
method not found in imported class - JCAPS6
null is what type of data type