Can a non-static method be accessed from a static method? And can a static method be accessed from a non-static method?
3 Answers
To access a non-static method, you need to have an instance of an object. If you are inside a static method, then you are not able to call non-static method, because, per definition, you are not "inside" an object (so you don't have any object to call this method on). You can however call non-static methods from static if you have a reference to the object you want to call the non-static method on.