subject

Public class food{ public void eat(){ System. out. println("I am the eat method"); } } public class tuna extends food { public void eat(){ System. out. println("I am the eat tuna method"); } } public class potpie extends tuna { } public class Driver { public static void main(String[] args){ food buffet[]= new food[2]; buffet[0]= new tuna(); buffet[1]= new potpie(); for(int i = 0; i<2; i++) buffet[i].eat(); } } write the answer that best describes the highlighted code.

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 19:20
1)consider the following code snippet: #ifndef book_h#define book_hconst double max_cost = 1000.0; class book{public: book(); book(double new_cost); void set_cost(double new_cost); double get_cost() const; private: double cost; }; double calculate_terms(book bk); #endifwhich of the following is correct? a)the header file is correct as given.b)the definition of max_cost should be removed since header files should not contain constants.c)the definition of book should be removed since header files should not contain class definitions.d)the body of the calculate_terms function should be added to the header file.
Answers: 1
question
Computers and Technology, 23.06.2019 00:50
Representa os dados de um banco de dados como uma coleç? o de tabelas constituídas por um conjunto de atributos, que definem as propriedades ou características relevantes da entidade que representam. marque a alternativa que representa o modelo descrito no enunciado. escolha uma:
Answers: 3
question
Computers and Technology, 23.06.2019 11:00
How should you specify box sizes on a web page if you want the boxes to vary according to the font size of the text they contain? a. in pixels b. in inches c. as percentages d. in em units
Answers: 2
question
Computers and Technology, 23.06.2019 11:30
Which excel file extension stores automated steps for repetitive tasks?
Answers: 1
You know the right answer?
Public class food{ public void eat(){ System. out. println("I am the eat method"); } } public class...
Questions
question
Social Studies, 20.08.2019 14:10
Questions on the website: 13722367