This way like you did it can be called a non-static method from the static method.
To call a non-static method from a static method, you have to create an new reference of the class in which the non-static method is in.
So your Data1 method is in Foo class, you have to create a new referenc (Foo foo = new Foo()) to be allowed to go out of static method.