Can an Static Method call an Instance Method in Java

So I just started programming and what not and this question has me tearing my hair off. It's asking "Under what circumstances, if any, can a static method call an instance method?" I've tried going back to the chapters where it mentions both methods and get no hints. Can someone help?Would be appreciated.

Jon Skeet
people
quotationmark

Static methods can always call instance methods - so long as they have a reference to an instance on which to call the method.

For example:

public static void main(String[] args) {
    String foo = "hello";
    System.out.println(foo.length());
}

length() is an instance method on String, main is a static method, but I'm still fine to call it... because foo provides a reference.

The only difference between static methods and instance methods in this regard is that an instance method implicitly has a reference to the type in which the method is declared - this.

people

See more on this question at Stackoverflow