The difference is that s1 is a member of the class, whereas s is a local variable in the main method. The reason you're getting an error is that you can't have loose statements in the class body.
The line s1 = new String should be either in a method or constructor body, or you should initialize s1 directly.
What a tricky thread name! I got all excited that someone just wanted to say hi and THEN I feel very deceived when I find out there is a question in here! There must be some evil mastermind behind this dastardly thread!