Public class Road
{
private String roadName;
public Road(String name)
{
ro...
![subject](/tpl/images/cats/informatica.png)
Computers and Technology, 27.04.2021 15:30 brandontru
Public class Road
{
private String roadName;
public Road(String name)
{
roadName = name;
}
}
public class Highway extends Road
{
private int speedLimit;
public Highway(String name, int limit)
{
super(name);
speedLimit = limit;
}
}
The following code segment appears in a method in another class.
Road r1 = new Highway("Interstate 101", 55); // line 1
Road r2 = new Road("Elm Street"); // line 2
Highway r3 = new Road("Sullivan Street"); // line 3
Highway r4 = new Highway("New Jersey Turnpike", 65); // line 4
Which of the following best explains the error, if any, in the code segment?
A) Line 1 will cause an error because a Road variable cannot be instantiated as an object of type Highway.
B) Line 2 will cause an error because the Road constructor is not properly called.
C) Line 3 will cause an error because a Highway variable cannot be instantiated as an object of type Road.
D) Line 4 will cause an error because the Highway constructor is not properly called.
E) The code segment compiles and runs without error.
![ansver](/tpl/images/cats/User.png)
Answers: 1
![](/tpl/images/ask_question.png)
![](/tpl/images/ask_question_mob.png)
Other questions on the subject: Computers and Technology
![image](/tpl/images/cats/informatica.png)
Computers and Technology, 22.06.2019 06:50, phillipfruge3
Match the personality traits with their description
Answers: 1
![image](/tpl/images/cats/informatica.png)
![image](/tpl/images/cats/informatica.png)
Computers and Technology, 24.06.2019 06:30, hannahgracew12
Some peer-to-peer networks have a server and some don't. true false
Answers: 2
![image](/tpl/images/cats/informatica.png)
Computers and Technology, 24.06.2019 10:40, 29delphina
Joe needs to see the slide transitions and animations he has applied to his slides in a large view. which presentation view should he use? in which tab would joe find the animations option to make further changes, if any?
Answers: 1
You know the right answer?
Questions in other subjects:
![Konu](/tpl/images/cats/mat.png)
![Konu](/tpl/images/cats/es.png)
Spanish, 27.03.2021 04:10
![Konu](/tpl/images/cats/mat.png)
![Konu](/tpl/images/cats/mat.png)
![Konu](/tpl/images/cats/mat.png)
Mathematics, 27.03.2021 04:10
![Konu](/tpl/images/cats/health.png)
Health, 27.03.2021 04:10
![Konu](/tpl/images/cats/istoriya.png)
History, 27.03.2021 04:10
![Konu](/tpl/images/cats/mat.png)
Mathematics, 27.03.2021 04:10
![Konu](/tpl/images/cats/mat.png)
Mathematics, 27.03.2021 04:10