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
Consider the following code segment. How many unique new (do not count the starting process) processes are created? (you may wan
valkas [14]

The number of unique processes that are created is in the original process, you get the PID of the child process. In the child process, you get 0.

<h3>What is a Code Segment?</h3>

This refers to the portion of an object file that is in the virtual space of a computer that contains executable instructions.

Hence, we can note that since PID >= 0, then there would be the creation of two identical processes in which the original process returns the PID of the child process, and the output in the child process would be zero.

If we make use of a canonical tag,

p = fork();\\if (0 == p)

{

   // We're the child process

}

else if (p > 0)

{

   // We're the parent process

}

else

{

   // We're the parent process, but the child couldn't be created

}

Read more about code segments here:

brainly.com/question/25781514

#SPJ1

3 0
3 years ago
Type the correct answer in the box. Spell all words corre ctly.
Andru [333]

Answer:

publication file I think ?

5 0
3 years ago
Read 2 more answers
Write and test a program that computes the area of a circle. This program should request a number representing a radius as input
Alla [95]

The program that computes the area of a circle is represented as follows:

x = int(input("Write the length of the radius of the circle: "))

area = 3.14 * x**2

print(area)

The code is written in python

<h3>Code explanation:</h3>
  • The first line of code ask the user to input the length of the radius. The variable x is used to store the user's input.
  • The variable "area" is used to store the arithmetic manipulation of area of a circle.
  • Then, we print the variable "area". This will print the actual area of the circle with the particular radius you inputted.

learn more on python program: brainly.com/question/16398286?referrer=searchResults

6 0
2 years ago
Does someone know what type of usb is that one called?
Doss [256]
It is USB 2.0 mini b 5 pin

3 0
3 years ago
Read 2 more answers
Write a program to implement the algorithm that you designed in Exercise 21 of Chapter 1. Your program should allow the user to
Murrr4er [49]

Answer:

total = 0

items = int(input("Enter the number of items ordered: "))

for i in range(items):

   price = float(input("Enter the price of item " + str(i+1) + ": "))

   total += price

if total < 200:

   total += (items * 10)

   

print("Bill is $" + str(total))

Explanation:

*The code is in Python.

Ask the user to enter the number of items ordered

Create a for loop that iterates depending on the number of items ordered. Inside the loop, ask the price of each item and add it to the total

After the loop, check the total. If it is smaller than 200, add 10 for each item to the total

Print the total

4 0
4 years ago
Other questions:
  • The English (or Shakespearean) sonnet form includes three quatrains and a couplet two quatrains and a couplet two quatrains and
    15·1 answer
  • One of the best examples of outcome control is the re-hiring of Steve Jobs by Apple as CEO
    14·1 answer
  • You can join tables by using a condition in the ____ clause.​
    7·1 answer
  • Which of the following is considered both an input and output peripheral?
    10·1 answer
  • What will be the result of running the following code fragment? int year = 0; double rate = 5; double principal = 10000; double
    14·1 answer
  • To maintain her audience's confidence in her, what should kiara not do while delivering her presentation?
    10·1 answer
  • One example of a <br> is the length of a car.
    7·1 answer
  • What is responsible for recording an image of an object with camera <br> Pls I neeed it right know
    8·1 answer
  • Question # 4
    5·1 answer
  • 4. In a relational database, entities are defined by
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!