Examples of using Superclass in English and their translations into Ukrainian
{-}
-
Colloquial
-
Ecclesiastic
-
Computer
Copy the method to the superclass.
A superclass can have multiple subclasses.
Merge the subclass and superclass.
Here's the code in the superclass Collection that does the work:.
Create a constructor in a superclass.
But the superclass and subclass are completely different.
Inherited from the superclass.
Place the call for the superclass constructor in the first line in the subclass constructors.
A subclass can inherit from a superclass.
Move the algorithm structure and identical steps to a superclass, and leave implementation of the different steps in the subclasses.
The subclass inherits from the superclass.
Solution: Create a field and put a superclass object in it, delegate methods to the superclass object, and get rid of inheritance.
Solution: Merge the subclass and superclass.
For methods inherited from the superclass that are called in the client code, create simple delegating methods in the subclass.
Classes may inherit features from the superclass.
Now you can start to move the fields and methods from the superclass to the corresponding state subclasses(using Push Down Field and Push Down Method).
Create a field with the same name in the superclass.
Delete the field with type code from the superclass. Make its getter abstract.
And finally, pull up the main method of the algorithm to the superclass.
Push Down MethodProblem: Is behavior implemented in a superclass used by only one(or a few) subclasses?
Declare the method in a subclass and copy its code from the superclass.
The compiler uses thefirst method it finds by depth-first searching of the superclass list or using the C3 linearization of the class hierarchy.
You can notapply this technique to classes that already have a superclass.
See whether the method is defined in a superclass or subclass.
The class from which inheritance is made is called the base, parent, or superclass.
See whether the method is defined in a superclass or subclass.
Create a static factory method with the same parameters as the superclass constructor.
Change the subclass methods so that they use the superclass object instead of this.
Suppose a program contains three classes in an inheritance hierarchy: a superclass, Cat, and two subclasses, HouseCat and Lion.
The process of attributes collectingis very similar to the inheritance of properties from superclass to subclasses in object-oriented programming system.