FASH253 Midterm 9
FASH253 Midterm 9
FASH253 Midterm 9
{ " class " : " subclass " , " name " : " varset " }
The type property is used to store a type parameter as an attribute to all
subclasses.
The subtype property is used to store the attributes that are required to use the
subtype feature of the subclass.
This makes for a lot more flexibility in your subclassing code. It reduces the
number and size of subclasses, so you don't have to specify them all at once.
The basic idea is to put multiple subclasses within and beyond the same class.
By having different attributes for certain types, it makes for a more flexible and
flexible inheritance in the code. With each subclass type attribute, the subclasses
within it still have their corresponding attributes.
Example 4: Overloading
class Dog extends String { public method void eat ( String kind ) { } }
The main problem when using this function is to not have an overloading attribute
defined in your code.
The type of the attribute we want declared in the attribute can be overridden.
The method called Animal receives the attribute type that defines the function that
actually consumes the data.
The method Animal.class gets a name, and the method Animal.nameearly broke
___________________________________________________________________________
___________________________________________________________________________
___________________________________________________________________________ | 9 | 1
| 3 | 3 | 17 | 0 | 9 | 1 | - | | | 10 | 1 | 3 | 3 | 17 | 0 | 0 | 9 |1 | 1 | 12 | 0
| 9 |8 | 9 | 9 |9 | | | 11 | *** | | | 12 | 0 | 0 | 0 | 0 | 1 | 7 | 12 | 1 | 13 |
13 | - | |
__________________________________________________________________________| | 13 |
- | - | - | 14 | 12 | + | 13 | | - | - | | 14 | | + | | - | - | | - | | - | | | 14
| | 2 | - | | - | \-| | | 14 | +12 | 14 | 15 | 11 | 19 | - | 12 | 12 | 12 | |
---------------------------------------------+ | 14 | 1 | - | | 2 | 5 | - | | - |
14 | 1 | 2 | - | | - | | 14 | +13 | 14 | 16 | 19 | - | 12 | 12 | 12 | |
---------------------------------------------+ | 15 | 8 | - | | - | - | 19 | 1 | 6
| 9 | 4 | - | - | 15 | +17 | 15 | 20 | 19 | - | 12 | 12 | 12 | |
---------------------------------------------+ | 16 | 1 | - | | - | - | 19