Two things:
1st thing: "Amir_Ghahrai"
Welcome to the JavaRanch! Please adjust your displayed name to match the
JavaRanch Naming Policy. Particularly, it should be first name <space> last name.
You can change it
here.
2nd thing;
You can declare and initialize a reference on a single line outside of a method.
But to initialize the reference on its own (without the declaration) -- the expression must be within a method (like a constructor).
Hope that helps, and again welcome to the JavaRanch!