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 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 Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "static variable in method" Watch "static variable in method" New topic

static variable in method

aruna ver

Joined: Jun 24, 2002
Posts: 8
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
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
jQuery in Action, 2nd edition
subject: static variable in method
Similar Threads
null is what type of data type
Static Variables
Static method question
Inetaddress - Compilation error
method not found in imported class - JCAPS6