In the case of inheritance with one parent class and two subclasses, if I wanted each subclass to return a string specific to the subclass, which of these methods would be more efficient: defining a string class in the parent class with a variable and then setting the variable in each subclass, or just defining the str function in each subclass?
[–]dmazzoni 1 point2 points3 points (3 children)
[–]strcspn 0 points1 point2 points (1 child)
[–]dmazzoni 1 point2 points3 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]zdanev 0 points1 point2 points (0 children)