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
labwork [276]
3 years ago
8

Consider the following classes: public class Vehicle {...} public class Car extends Vehicle {...} public class SUV extends Car {

...} Self-Check Problems 617 Which of the following are legal statements? a. Vehicle v = new Car(); b. Vehicle v = new SUV(); c. Car c = new SUV(); d. SUV s = new SUV(); e. SUV s = new Car(); f. Car c = new Vehicle();
Computers and Technology
1 answer:
Kitty [74]3 years ago
7 0

Answer:

Legal statements:

      SUV s = new SUV();

      Car c = new SUV();

      Vehicle v = new SUV();

      Vehicle v1 = new Car();

illegal statements:

      SUV s1 = new Car();

      Car c1 = new Vehicle();

Explanation:

The options a, b, c, d are correct and legal statements because the syntax is correct, they follow the inheritance principles and therefore can be used for type cast.

The options e, f are incorrect and illegal statements because they do not follow the inheritance principles and therefore can not be used for type cast.

You might be interested in
Edible vaccines, a more controversial approach to vaccine development, have been investigated by scientists. Plants can be genet
madreJ [45]
I need some more information. If you need any more help with this please leave a relpy.
8 0
4 years ago
How is the go button on m computer?
bearhunter [10]

<span>Go appears in the menu bar when Finder has focus, not in the Finder window.</span>
7 0
3 years ago
When you expand the virtual size of a game, what do you create?
dangina [55]
I think the answer is c
3 0
3 years ago
What type of protocol provides a way to transfer files from one computer to another over tcp/ip such as lan?
leva [86]
FTP provides this functionality.
5 0
4 years ago
What function affects the cookies downloaded into the host when playing a video clip?
sukhopar [10]

Answer:

Privacy

Explanation:

7 0
3 years ago
Other questions:
  • Binary search requires that data to search be in order. true or false
    5·1 answer
  • How does an employer judge a candidate?<br> The employer judge's the candidate's ? for a job.
    12·1 answer
  • The World Wide Web (WWW) is a network of links on the Internet to documents containing text, graphics, video, and sound, but doe
    10·1 answer
  • Which speaker port should you use when connecting a single speaker to a pc?
    6·1 answer
  • In order to use an object in a program, its class must be defined.
    9·1 answer
  • Field names should NOT start with a(n) -<br> hyphen (-)<br> Oa<br> asterisk (*)<br> space()
    8·1 answer
  • A circuit rated at 6600 watts and 240 volts will draw what ampers.
    6·1 answer
  • A RISC processor has 186 total registers, with 18 global registers. There are 12 register windows, each with 10 locals. How many
    5·1 answer
  • Anyone know how to delete it in my laptop
    10·1 answer
  • What is boot sector virus​
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!