1. Engineering
  2. Computer Science
  3. java polymorphism...

Question: java polymorphism...

Question details

Fruit Apple Orange + makeAppleCider) void + makeOrange Juice) void GoldenDelicious Mclntosh And assume that the following code is given: Fruit fruit = new G ldenDe ї icious(); Orange orange = new Orange(); Answer the following questions, and explain your answer. a. Isfruit instanceof Fruit? b. Is fruit instanceof Orange? c. Is fruit instanceof Apple? d. Is fruit instanceof GoldenDelicious? e. Is fruit instanceof McIntosh? f. Is orange instanceof Orange? g. Is orange instanceof Fruit? h. Is orange instanceof Apple? i. Can fruit invoke makeAppleCider method? . Can orange invoke makeAppleCider method? k. Can fruit invoke makeOrangeJuice method? I. Can orange invoke makeOrangeJuice method? m. Is the statement Orange pnew Apple () legal? n. Is the statement McIntosh p new Apple() legal? o. Is the statement Apple pnew McIntosh () legal?Java polymorphism

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution