Please post details of your error messages for our information and convenience.
Ok, s1.supName should be placed inside a method/constructor body. (See that in your original program, doing s1.supName = "vic hOOD"; will ALSO give a compiler error.)
The code :
BUT ! This code will still not work ! Because s1.supName; is NOT a statement, as shown by the compiler.
A statement is a variable declaration , variable assignment or a method call.
Source :
http://www.docstoc.com/docs/9849500/What-is-a-Java-Statement
So change the code as follows and it compiles :