SlideShare une entreprise Scribd logo
1  sur  1
Télécharger pour lire hors ligne
Language/Type: Java inheritance polymorphism Assume that the following classes have been
defined:Given the classes above, what output is produced by the following code? (Since the code
loops over the elements of an array of objects, write the output produced as the loop passes over
each element of the array separately.) Arya[] thrones ={ new Oberyn(), new Arya(), new Brienne(),
new Tyrion() }; for (int i=0;i< thrones.length; i++){ thrones[i].a(): System, out.printin(); System.
out.print ln( thrones [i]); thrones [i],b(); System, out.println(); System, out.println():element 0
element 1 element 2 element 3

Contenu connexe

Plus de adityacommunication1

Lab8 Controlling traffic using Extended ACL Objectives Per.pdf
Lab8  Controlling traffic using Extended ACL Objectives Per.pdfLab8  Controlling traffic using Extended ACL Objectives Per.pdf
Lab8 Controlling traffic using Extended ACL Objectives Per.pdf
adityacommunication1
 
lab 7 volcanos Emaglai St Maina kea and whata Use these map.pdf
lab 7 volcanos  Emaglai St Maina kea and whata Use these map.pdflab 7 volcanos  Emaglai St Maina kea and whata Use these map.pdf
lab 7 volcanos Emaglai St Maina kea and whata Use these map.pdf
adityacommunication1
 
La venta al por menor de prendas de vestir ha cambiado Ya n.pdf
La venta al por menor de prendas de vestir ha cambiado Ya n.pdfLa venta al por menor de prendas de vestir ha cambiado Ya n.pdf
La venta al por menor de prendas de vestir ha cambiado Ya n.pdf
adityacommunication1
 
La Universidad Johns Hopkins cometi recientemente un gran e.pdf
La Universidad Johns Hopkins cometi recientemente un gran e.pdfLa Universidad Johns Hopkins cometi recientemente un gran e.pdf
La Universidad Johns Hopkins cometi recientemente un gran e.pdf
adityacommunication1
 
La toma de decisiones no rutinarias que se produce en respue.pdf
La toma de decisiones no rutinarias que se produce en respue.pdfLa toma de decisiones no rutinarias que se produce en respue.pdf
La toma de decisiones no rutinarias que se produce en respue.pdf
adityacommunication1
 
La principal diferencia entre los mtodos de pago y compr.pdf
La principal diferencia entre los mtodos de pago y compr.pdfLa principal diferencia entre los mtodos de pago y compr.pdf
La principal diferencia entre los mtodos de pago y compr.pdf
adityacommunication1
 

Plus de adityacommunication1 (20)

Lab8 Controlling traffic using Extended ACL Objectives Per.pdf
Lab8  Controlling traffic using Extended ACL Objectives Per.pdfLab8  Controlling traffic using Extended ACL Objectives Per.pdf
Lab8 Controlling traffic using Extended ACL Objectives Per.pdf
 
Lab Task 2 Use the below code and fill it in where appropri.pdf
Lab Task 2 Use the below code and fill it in where appropri.pdfLab Task 2 Use the below code and fill it in where appropri.pdf
Lab Task 2 Use the below code and fill it in where appropri.pdf
 
Lab Task 5 Points As a programmer in a company you were .pdf
Lab Task 5 Points As a programmer in a company you were .pdfLab Task 5 Points As a programmer in a company you were .pdf
Lab Task 5 Points As a programmer in a company you were .pdf
 
La mutacin del ojo sepia se es una mutacin recesiva no l.pdf
La mutacin del ojo sepia se es una mutacin recesiva no l.pdfLa mutacin del ojo sepia se es una mutacin recesiva no l.pdf
La mutacin del ojo sepia se es una mutacin recesiva no l.pdf
 
LAB EXERCISES 1 Create a table employee with emp_noemp_n.pdf
LAB EXERCISES 1 Create a table employee with emp_noemp_n.pdfLAB EXERCISES 1 Create a table employee with emp_noemp_n.pdf
LAB EXERCISES 1 Create a table employee with emp_noemp_n.pdf
 
lab 7 volcanos Emaglai St Maina kea and whata Use these map.pdf
lab 7 volcanos  Emaglai St Maina kea and whata Use these map.pdflab 7 volcanos  Emaglai St Maina kea and whata Use these map.pdf
lab 7 volcanos Emaglai St Maina kea and whata Use these map.pdf
 
La venta al por menor de prendas de vestir ha cambiado Ya n.pdf
La venta al por menor de prendas de vestir ha cambiado Ya n.pdfLa venta al por menor de prendas de vestir ha cambiado Ya n.pdf
La venta al por menor de prendas de vestir ha cambiado Ya n.pdf
 
La Universidad Johns Hopkins cometi recientemente un gran e.pdf
La Universidad Johns Hopkins cometi recientemente un gran e.pdfLa Universidad Johns Hopkins cometi recientemente un gran e.pdf
La Universidad Johns Hopkins cometi recientemente un gran e.pdf
 
La transcripcin es el proceso mediante el cual la enzima _.pdf
La transcripcin es el proceso mediante el cual la enzima _.pdfLa transcripcin es el proceso mediante el cual la enzima _.pdf
La transcripcin es el proceso mediante el cual la enzima _.pdf
 
La ventaja potencial de la dilucin de acciones es que R E.pdf
La ventaja potencial de la dilucin de acciones es que R E.pdfLa ventaja potencial de la dilucin de acciones es que R E.pdf
La ventaja potencial de la dilucin de acciones es que R E.pdf
 
La transcriptasa inversa es conocida por tener poca activida.pdf
La transcriptasa inversa es conocida por tener poca activida.pdfLa transcriptasa inversa es conocida por tener poca activida.pdf
La transcriptasa inversa es conocida por tener poca activida.pdf
 
La teora del orden jerrquico de MyersMajluf predice que l.pdf
La teora del orden jerrquico de MyersMajluf predice que l.pdfLa teora del orden jerrquico de MyersMajluf predice que l.pdf
La teora del orden jerrquico de MyersMajluf predice que l.pdf
 
La toma de decisiones no rutinarias que se produce en respue.pdf
La toma de decisiones no rutinarias que se produce en respue.pdfLa toma de decisiones no rutinarias que se produce en respue.pdf
La toma de decisiones no rutinarias que se produce en respue.pdf
 
La tecnologa avanza rpidamente en muchos Servicios de Apoy.pdf
La tecnologa avanza rpidamente en muchos Servicios de Apoy.pdfLa tecnologa avanza rpidamente en muchos Servicios de Apoy.pdf
La tecnologa avanza rpidamente en muchos Servicios de Apoy.pdf
 
La teora de los fondos prestables del inters muestra que l.pdf
La teora de los fondos prestables del inters muestra que l.pdfLa teora de los fondos prestables del inters muestra que l.pdf
La teora de los fondos prestables del inters muestra que l.pdf
 
La Revolucin Industrial fue un factor en una explosin demo.pdf
La Revolucin Industrial fue un factor en una explosin demo.pdfLa Revolucin Industrial fue un factor en una explosin demo.pdf
La Revolucin Industrial fue un factor en una explosin demo.pdf
 
La reproduccin en uno de los siguientes rdenes implica el .pdf
La reproduccin en uno de los siguientes rdenes implica el .pdfLa reproduccin en uno de los siguientes rdenes implica el .pdf
La reproduccin en uno de los siguientes rdenes implica el .pdf
 
La responsabilidad es clara Hay ventajas de ahorro de cost.pdf
La responsabilidad es clara  Hay ventajas de ahorro de cost.pdfLa responsabilidad es clara  Hay ventajas de ahorro de cost.pdf
La responsabilidad es clara Hay ventajas de ahorro de cost.pdf
 
La principal diferencia entre los mtodos de pago y compr.pdf
La principal diferencia entre los mtodos de pago y compr.pdfLa principal diferencia entre los mtodos de pago y compr.pdf
La principal diferencia entre los mtodos de pago y compr.pdf
 
La principal diferencia entre un celoma y un pseudoceloma es.pdf
La principal diferencia entre un celoma y un pseudoceloma es.pdfLa principal diferencia entre un celoma y un pseudoceloma es.pdf
La principal diferencia entre un celoma y un pseudoceloma es.pdf
 

Dernier

Dernier (20)

Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the Classroom
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
 
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
Plant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptxPlant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptx
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 

LanguageType Java inheritance polymorphism Assume that the.pdf

  • 1. Language/Type: Java inheritance polymorphism Assume that the following classes have been defined:Given the classes above, what output is produced by the following code? (Since the code loops over the elements of an array of objects, write the output produced as the loop passes over each element of the array separately.) Arya[] thrones ={ new Oberyn(), new Arya(), new Brienne(), new Tyrion() }; for (int i=0;i< thrones.length; i++){ thrones[i].a(): System, out.printin(); System. out.print ln( thrones [i]); thrones [i],b(); System, out.println(); System, out.println():element 0 element 1 element 2 element 3