This article is just a record of my Learning the crazy Java handout, the previous Java knowledge to check the gaps in the summary.
Method overrides
Method overrides to follow the "two same two small one big" rule. "Two identical" means the method name is the same, the formal parameter list is the same, "two small" refers to the subclass method return value type should be more than the parent class method return value type is smaller or equal, subclass method declaration Throw exception class should be more than the parent class method declaration throw exception class smaller or equal; A large "refers to the subclass method that access permissions should be greater or equal than the parent class method access. In particular, the overriding method and the overridden method are either class methods or instance methods, not one class method and one instance method; for example:
Super Limit
Inherit attention Point
Crazy Java handouts--inheritance