Is there any technical difference between a subclass and an inherited class?
问题 Is there any technical difference between a class which inherits from another class and a class which is a subclass of it? What's the difference between A and B in the following code: A) public class foo { ... private class bar {...} } B) public class foo { ...} private class bar extends foo {...} 回答1: In the inheriting situation, you can treat the derived class like its base class. That is, you can keep a collection of base class references around and call their methods without needing to