Hi, Your statement (System.out.println) must be inside a method. You just can declare and initialize class variable and instance variable at that place. You can learn about that in the Java Language Specification
You can indeed not have any code outside a method or initializer block. The one exception to this are calls to new to initialize objects, and those calls can only contain literals as arguments if I'm not mistaken.
Lasagna is spaghetti flvored cake. Just like this tiny ad: