You should not declare your method
static unless you are invoking it directly in a static context.
If you want to invoke it directly in main method (a static method), you must declare it as static
Look at the following use:
In the snippet of code your method
theAverge has to be static, because i am invoking it inside a static method (the
main method) directly.
But look at this:
now you create an object of class
Operations_with_Array and you invoke the method
theAverage on that object.
The method now is an instance method, not a static method.