Question: Given the inheritance hierarchy below, what does the following program print to the console, given that the addresses (in hexadecimal) of the objects in the

 Given the inheritance hierarchy below, what does the following program print
to the console, given that the addresses (in hexadecimal) of the objects

Given the inheritance hierarchy below, what does the following program print to the console, given that the addresses (in hexadecimal) of the objects in the array t are as follows: [0]: 473d7432 [1]: 3b796875 [2): 616181be t[3] 488d12e4 Food [I1 = { new Food, new Fruit, new Apple ('red'), new Orange(Valencia)}; for (int i=0; ict.length; i++) System.out.printin(f): class Food puble boolean cook 1 class Fruit extends Foodt public double site 1 class Apple extends Fruit pllie Strang color puble Apple String color){this.color-color: override public String costring retum This is an apple with color- eless Orange extends Fruit public String typer publie Orange String type (this.type-type: 1 @Override puble String tostring return "Thissaan orange of type typer Select one: Select one: Od Food473d7432 Food@3b796875 This is an apple with color red This is an orange of type valencia b. Food@473d7432 This is a fruit This is an apple with color red This is an orange of type valencia OC Food47347432 Food3b706876 Food 616181be Food4880124 Od Food 47307432 Fruit3b706875 Applom61618be Orange48801204 Food 047307432 Fruit3670687 This is an apple with color red This is an orange of type valencia . 2

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!