When a member is declared static , it can be accessed before any objects of it's class are created , & without reference to any object .
What this means is that the static member can be used by itself , without reference to a specific instance . When u the declare the String as static in the main() method it refers to that particular instance of main() which it shouldn't (or can't) . To sort out your problem put your static statement before the main() .
This is also the reason why main() is declared static 'cause it needs to be called before any objects exist .
U'r thing made me post "== operator checks for object references" in the beginners area . Check it out .
It's 8 am & i still haven't slept .
Java is just too stimulating . And in case what i wrote is weird then i probably need to sleep .
U would've got this 2 hrs earlier but my ISP sux !
[This message has been edited by Ashish Hareet (edited July 15, 2001).]