A static method cannot access non-static variable in general. But is there any way to do it?
posted 13 years ago
Welcome to JavaRanc, Jing Zhou! Concerning your question, what would it mean if you could access a non-static member from a static context? Why would you want to do such a thing? Note that from a static context, you can have a (static) reference to an instance of some object, and through that reference you can access members of the instance it refers to.