posted 20 years ago
In order to invoke an instance method (non-static), you need to have an instance of the object to invoke the instance upon. You have that. You created an A object and referenced it with the variable atest. Now that you have that object, you are free to invoke any methods on it you want, static or not, no matter what context you are in, static or not.
I think the error you were expecting would be better illustrated by this:
I hope that helps,
Corey