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[10] should be either in a method or constructor body, or
you should initialize s1 directly.