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
1. What arguments can you make for the idea of a single language for all programming domains
SVEN [57.7K]

Answer:

The answer to this question defined below.

Explanation:

It's a smart idea to get a common language for coding of every kind. It would help all developers and customers understand the language better because, in every case, there's no more need to learn, that language.  

  • This could also render software developed in the very same language consistent, and therefore, ports on multiple platforms are not required.
  • In this process, we talk about the common property and function of the classes, that's why it is the correct answer.
3 0
3 years ago
If you want to stop a loop before it goes through all of its iterations, the break statement may be used. Group of answer choice
NeX [460]

Answer:

Answer is true

Explanation:

6 0
2 years ago
A ___ is a node (or a device) that connects two different networks together and allows them to communicate.
stellarik [79]

Answer:

The answer is Hub

Explanation:

A hub, also called a network hub, is a common connection point for devices in a network. Hubs are devices commonly used to connect segments of a LAN. The hub contains multiple ports. When a packet arrives at one port, it is copied to the other ports so that all segments of the LAN can see all packets.

7 0
3 years ago
Create a TicTacToe class that initializes a 3x3 board of "-" values. We will use this class in future exercises to fully build o
kap26 [50]

Answer:

public class TicTacToe //Defining TicTacToe class

{

char board[3][3] ; //Creating a 2D array instance variable

TicTacToe() //Constructor to initialize the array with " - "

{

for( int i = 0;i<3;i++) //Loop for the row of array

{

for(int j = 0;j<3;j++) //Loop for the column of array

{

Board[i][j] = '-'; //Assigning "-" in each cell

}

}

}

public char getter() //Defining getter() method to return the array

{

return Board; //returning the array

}

}

8 0
3 years ago
Ivy is a student. She is looking for some freelance assignments during her vacation. Which of the following networking sites can
lara [203]

The answer is D. XING


3 0
3 years ago
Other questions:
  • Which of the following matching is true concerning the Protocol Data Unit (PDU) and its corresponding OSI layer location?
    15·1 answer
  • An app builder has created a report for sales people to view records from the custom object, some users have complained that the
    8·1 answer
  • An automated search feature used by search engines to find results that match your search terms is called a spider or ?
    5·1 answer
  • Your marketing director at ABC Marketing Agency would like to set up an email campaign that will use personalization to referenc
    5·1 answer
  • Write a program that asks you to enter some integers, and press "enter" after each one.
    13·1 answer
  • Which part of a touchscreen responds to pressure applied to its surface?
    6·1 answer
  • Not every organization integrates with the Internet, but all use some or most of the technology that gave rise to it.
    15·1 answer
  • What kind of skill is persuasion?
    7·1 answer
  • Why would you browse by entering a URL rather than use a link in a Web page
    15·1 answer
  • What are you win your good at tech
    7·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!