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 Servlets and the fly likes Static declaratoin problem? 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 » Java » Servlets
Bookmark "Static declaratoin problem?" Watch "Static declaratoin problem?" New topic

Static declaratoin problem?

marko markovic

Joined: Mar 16, 2001
Posts: 28
i could not declare a static variable in my JSp page. Why?
I tried : static int test = 0;
and get the following error:
Statement expected.
Could anyone tell me how can i declare a static variable?

Wolfgang Stein

Joined: Mar 26, 2001
Posts: 11
I use the following:
final static String NL = System.getProperty("line.separator");
It also works without the keyword 'final'.
Wolfgang Stein
I agree. Here's the link:
subject: Static declaratoin problem?
Similar Threads
Using final as program-wide variables
size of array
static variable inside static function
Variable access