1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
andrew-mc [135]
3 years ago
12

Consider the classes Food, Cheese, and Velveeta where Cheese is a subclass of Food and Velveeta is a subclass of Cheese. State w

hich of the following lines of code are legal.
Cheese c =new Food( );
Velveeta v =new Food( );
Cheese c =new Velveeta( );
Food f =new Velveeta( );
Food f =new Cheese( );
Computers and Technology
1 answer:
il63 [147K]3 years ago
6 0

Answer:

Cheese c =new Velveeta( );

Food f =new Velveeta( );

Food f =new Cheese( );

Explanation:

The super-class is the parent class from which features and attributes are inherited from while the subclass or the child class is the class inheriting from the super or parent class.

In Java, the object instance of a class is created with the syntax;

class_name instance_name = new class_name();

Food is the super or parent class of Cheese (which makes Cheese its subclass) and Cheese is the parent class of Velveeta. The extends keyword is used to denote inheritance.

You might be interested in
How would you create a tint of a color?
svetlana [45]
D. white with a hue
HOPE THIS HELPS
5 0
3 years ago
Para que se utiliza openoffice en la vida cotidiana?
Mama L [17]
OpenOffice se utiliza para organizar y presentar los datos o la información de otra manera.

espero y te ayude! : )
3 0
3 years ago
Read 2 more answers
WHAT DOES THE TRANSPORT LAYER USE TO MAKE SURE THAT A MESSAGE IS REASSWMBLED CORRECTLY ON THE RECEIVING DEVICES?
mrs_skeptik [129]
The answer is  sequence  number
6 0
3 years ago
If you sort a portion of an Excel sheet and you get an error message such as #DIV/0, what is a likely cause of the error message
yulyashka [42]
<span>If you sort a portion of an Excel sheet and you get an error message such as #DIV/0, the cause of the error message is (B) one or more cells containing absolute cell references. The possible reason of this error message includes: (1) e</span><span>ntering division formula that divided by zero (0), (2) and that is being used as a reference.</span>
7 0
3 years ago
When I try to add a module into a device, Packet Tracer pop-ups a warning message saying "Cannot add a module when the power is
laiz [17]

plug it into a charger the go to I tunes and it should be there


4 0
3 years ago
Other questions:
  • The code selection above is taken from the Color Sleuth activity you just completed. This selection would count as an abstractio
    12·1 answer
  • How Java provides protection through stack inspection approach ?
    7·1 answer
  • Sequentially prenumbered forms are an example of a(n): a. Processing control. b. Data transmission control. c. Input control. d.
    10·1 answer
  • The term "Cloud" refers to what option(s) below? (Select all that apply)
    13·1 answer
  • Of the sequences listed below, which shows the correct order of the steps in the incident management workflow: (1) authenticate
    14·1 answer
  • Whats the answer to this question?
    7·1 answer
  • All of these acts performed when doing an oil and filter change except ?
    9·2 answers
  • Write a statement that calls the recursive method backwardsAlphabet() with parameter startingLetter.
    8·1 answer
  • In honor of Black History Month, write an essay about a black person who has inspired YOU in some way. This person does not have
    8·1 answer
  • A column does not consist of
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!