Hey all,
Even I have faced the same scenario a little before, “A Non-static method cannot be referenced from a static context” error, A reference cannot be made from a static to a non-static method. ... Static variables are class variables that belong to the class with only one instance created initially.
But, to access instance variables it is a must to create an object, these are not available in the memory, before instantiation. Therefore, you cannot make a static reference to non-static fields(variables) in Java.