overkuded method, not an overidden method. Because the class Cat a class Animal,
ID: 3718751 • Letter: O
Question
overkuded method, not an overidden method. Because the class Cat a class Animal, il has access to the following two overloaded jump methods;iends the exte vosd ump system out print in("Animal)) vesd ump iint a) syatem out print In("cat")) The following lines of code create an object of class Cat and assign it t tvpe Animal Animai cat new Cat When you call the method jump on the previous object, it executes the method tun which doesn't accept any method parameters, printing the following value: Animal The following code will also print Animal and not Cat: Cat cat -new Cat cat jump 0 062. Given the following code, select the correct statements: class Flover ( class Rose ( class 1ily f class Bouquet ( publie void Eragrance ) (system.out.printin( Flower"), ) public void tragrance) (system.out.print in ("Rose"): ) publie void fragrance ) (system.out print In("tily");) publie void arzangeFlowers ) t Flover f1 -new Rose ) Flower f2 -new Lily(); £1.fragrance ) The output of the code is a Flower b The output of the code is Rose The output of the code is Lily The code fails to compile. e dExplanation / Answer
answer is d
Explanation: neither of the classes Rose and Lily extends flower class , so we cannot store the referrence of rose and lily objects in flower type so code fails to compile
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.