posted 22 years ago
First of all, I'm assuming that the method staticMethod is really supposed to be static. Otherwise, we don't have this problem.
The issue is that the variable y, defined within class SuperC, is an instance variable. You can't access an instance variable from a static context...EVER! An instance member requires an instance to be a part of. From a static context, you have no instance for that member to be part of, so you can't access it from there.
The converse is not true. You can access static members from a non-static context.
Corey