A static method can be invoked from anywhere the class is visible.
If the class is not explicitly specified, then it searches the
enclosing scopes looking for a suitable match. Instance method
require an object instance to invoke including an implicit 'this'.
BTW, you _can_ invoke a static using an object instance, the class
used is the class of the instance.
public class Foo {
public static void main(String[] args) {
hello();
}
public void hello() {
System.out.println("Hello, World!");
}
}
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden