SlideShare uma empresa Scribd logo
1 de 1
Baixar para ler offline
Choose ALL the messages that will be the output of the following program. interface Eatable{ void
eat(String tool); 3 interface Drinkable{ void drink(String tool); 3 class MilkShake implements
Eatable, Drinkable{ String name; public MilkShake(String aName) { name = aName; } public void
eat(String tool){ System.out.println("Eating "+name+" with "+tool); } public void drink(String tool){
System.out.println("Drinking "+name+" with "+tool); 3 } public class MainClass { public static void
main(String[] args){ Drinkable[]items = new Drinkable[] {new MilkShake("milk shake"),new
MilkShake("Ice cream shake")}; items[0].drink("straw"); ((Eatable)items[1]).eat("spoon"); } } Eating
Ice cream shake with spoon Eating lce cream shake with straw Eating milk shake with spoon
Eating milk shake with straw Drinking Ice cream shake with spoon Drinking Ice cream shake with
straw Drinking milk shake with spoon Drinking milk shake with straw

Mais conteúdo relacionado

Mais de aghsports

Cisconun Tedarik Zinciri Cisconun tedarik zinciri d kayna.pdf
Cisconun Tedarik Zinciri Cisconun tedarik zinciri d kayna.pdfCisconun Tedarik Zinciri Cisconun tedarik zinciri d kayna.pdf
Cisconun Tedarik Zinciri Cisconun tedarik zinciri d kayna.pdf
aghsports
 
Cinematix se vuelve mvil Cinematix Cinema ha revisado reci.pdf
Cinematix se vuelve mvil  Cinematix Cinema ha revisado reci.pdfCinematix se vuelve mvil  Cinematix Cinema ha revisado reci.pdf
Cinematix se vuelve mvil Cinematix Cinema ha revisado reci.pdf
aghsports
 
Choose one of these three options A IPC using FIFO B Shar.pdf
Choose one of these three options A IPC using FIFO B Shar.pdfChoose one of these three options A IPC using FIFO B Shar.pdf
Choose one of these three options A IPC using FIFO B Shar.pdf
aghsports
 

Mais de aghsports (20)

Clck the kon to view tre table A 147425 a H 425 H2lt4.pdf
Clck the kon to view tre table A 147425 a H 425 H2lt4.pdfClck the kon to view tre table A 147425 a H 425 H2lt4.pdf
Clck the kon to view tre table A 147425 a H 425 H2lt4.pdf
 
Classify the following data Indicate whether the data is qu.pdf
Classify the following data Indicate whether the data is qu.pdfClassify the following data Indicate whether the data is qu.pdf
Classify the following data Indicate whether the data is qu.pdf
 
Class Activity Perform a group of 3 member Choose any of th.pdf
Class Activity Perform a group of 3 member Choose any of th.pdfClass Activity Perform a group of 3 member Choose any of th.pdf
Class Activity Perform a group of 3 member Choose any of th.pdf
 
Class Buttercup public Buttercupint baddifs num_punc.pdf
Class Buttercup  public  Buttercupint baddifs  num_punc.pdfClass Buttercup  public  Buttercupint baddifs  num_punc.pdf
Class Buttercup public Buttercupint baddifs num_punc.pdf
 
class People protected string name int age public XXX .pdf
class People  protected string name int age public XXX .pdfclass People  protected string name int age public XXX .pdf
class People protected string name int age public XXX .pdf
 
Clasifique cada ejemplo o definicin segn se aplique al gen.pdf
Clasifique cada ejemplo o definicin segn se aplique al gen.pdfClasifique cada ejemplo o definicin segn se aplique al gen.pdf
Clasifique cada ejemplo o definicin segn se aplique al gen.pdf
 
Circuit diagram Please build the following circuit and test.pdf
Circuit diagram Please build the following circuit and test.pdfCircuit diagram Please build the following circuit and test.pdf
Circuit diagram Please build the following circuit and test.pdf
 
Choose the incorrect statement below A X is an estimator .pdf
Choose the incorrect statement below A X is an estimator .pdfChoose the incorrect statement below A X is an estimator .pdf
Choose the incorrect statement below A X is an estimator .pdf
 
Cisconun Tedarik Zinciri Cisconun tedarik zinciri d kayna.pdf
Cisconun Tedarik Zinciri Cisconun tedarik zinciri d kayna.pdfCisconun Tedarik Zinciri Cisconun tedarik zinciri d kayna.pdf
Cisconun Tedarik Zinciri Cisconun tedarik zinciri d kayna.pdf
 
CISC 341 Computer Architecture You must show your work to.pdf
CISC 341 Computer Architecture  You must show your work to.pdfCISC 341 Computer Architecture  You must show your work to.pdf
CISC 341 Computer Architecture You must show your work to.pdf
 
Cinematix se vuelve mvil Cinematix Cinema ha revisado reci.pdf
Cinematix se vuelve mvil  Cinematix Cinema ha revisado reci.pdfCinematix se vuelve mvil  Cinematix Cinema ha revisado reci.pdf
Cinematix se vuelve mvil Cinematix Cinema ha revisado reci.pdf
 
CIGS thinfilm solar modules are potentially competitive wit.pdf
CIGS thinfilm solar modules are potentially competitive wit.pdfCIGS thinfilm solar modules are potentially competitive wit.pdf
CIGS thinfilm solar modules are potentially competitive wit.pdf
 
Choose the correct statement below A Estimators do not gen.pdf
Choose the correct statement below A Estimators do not gen.pdfChoose the correct statement below A Estimators do not gen.pdf
Choose the correct statement below A Estimators do not gen.pdf
 
Choose the correct word to complete these descriptions of st.pdf
Choose the correct word to complete these descriptions of st.pdfChoose the correct word to complete these descriptions of st.pdf
Choose the correct word to complete these descriptions of st.pdf
 
Choose one of these three options A IPC using FIFO B Shar.pdf
Choose one of these three options A IPC using FIFO B Shar.pdfChoose one of these three options A IPC using FIFO B Shar.pdf
Choose one of these three options A IPC using FIFO B Shar.pdf
 
CHOOSE ONLY ONE OF THE FOLLOWING 7 marks 1 Describe in .pdf
CHOOSE ONLY ONE OF THE FOLLOWING 7 marks 1 Describe in .pdfCHOOSE ONLY ONE OF THE FOLLOWING 7 marks 1 Describe in .pdf
CHOOSE ONLY ONE OF THE FOLLOWING 7 marks 1 Describe in .pdf
 
Choose the correct answer 1 The method _ is called by the .pdf
Choose the correct answer 1 The method _ is called by the .pdfChoose the correct answer 1 The method _ is called by the .pdf
Choose the correct answer 1 The method _ is called by the .pdf
 
Choose your own project idea or select one of the following.pdf
Choose your own project idea or select one of the following.pdfChoose your own project idea or select one of the following.pdf
Choose your own project idea or select one of the following.pdf
 
choose the correct answer 1 Water will flow into the beaker.pdf
choose the correct answer 1 Water will flow into the beaker.pdfchoose the correct answer 1 Water will flow into the beaker.pdf
choose the correct answer 1 Water will flow into the beaker.pdf
 
Choose the best description of a cDNA library a mixture o.pdf
Choose the best description of a cDNA library a mixture o.pdfChoose the best description of a cDNA library a mixture o.pdf
Choose the best description of a cDNA library a mixture o.pdf
 

Último

1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
QucHHunhnh
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
QucHHunhnh
 
Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.
MateoGardella
 

Último (20)

Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
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.
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 

Choose ALL the messages that will be the output of the follo.pdf

  • 1. Choose ALL the messages that will be the output of the following program. interface Eatable{ void eat(String tool); 3 interface Drinkable{ void drink(String tool); 3 class MilkShake implements Eatable, Drinkable{ String name; public MilkShake(String aName) { name = aName; } public void eat(String tool){ System.out.println("Eating "+name+" with "+tool); } public void drink(String tool){ System.out.println("Drinking "+name+" with "+tool); 3 } public class MainClass { public static void main(String[] args){ Drinkable[]items = new Drinkable[] {new MilkShake("milk shake"),new MilkShake("Ice cream shake")}; items[0].drink("straw"); ((Eatable)items[1]).eat("spoon"); } } Eating Ice cream shake with spoon Eating lce cream shake with straw Eating milk shake with spoon Eating milk shake with straw Drinking Ice cream shake with spoon Drinking Ice cream shake with straw Drinking milk shake with spoon Drinking milk shake with straw