Given the following UML diagram:
Variable Type | ||||||
Tossable | Ball | Rock | Baseball | Football | ||
Object Type | Tossable | |||||
Ball | ||||||
Rock | ||||||
Baseball | ||||||
Football |
1. Ball ball = new Football("spalding"); 2. Ball ball = new Football("Spalding"); Baseball baseball = (Baseball)ball; 3. Object obj = new Baseball("spalding"); 4. Object obj = new Baseball("spalding"); Tossable tossable = obj; 5. Tossable tossable = new Baseball("spalding"); Object obj = tossable; 6. Tossable tossable = new Baseball("spalding"); tossable.getBrandName();
toss
or bounce
methods.