Which lines cause a compile error? public class Vehicle { protected String nane; private int 10; public setID(int pID) (...) } public class Car extends Vehicle { private int siles; public Car() ( miles = 145;

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Hello! I have uploaded 4 questions per chegg recommendations and would like to see why I got my awnsers wrong. i marked them with a red x. if someone can explain why and the right answer ill thumbs up much appreciated by many

 

Which lines cause a compile error?
public class Vehicle {
protected String name;
private int ID;
public setID(int pID) {...}
}
public class Car extends Vehicle (
private int siles;
public Car() {
miles = 145;
setID(99);
ID - 47;
nane - "Honda";
2
}
O the erro
Oline 3 only
O lines 1 and 3
Olines 3 and 4
Given class SimpleCar, which line has a syntax error?
public class SimpleCer {
private int odometer;
public void drive(int miles) {
odometer odometer + miles;
}
1 Object objCar;
2 objCar new SimpleCar();
3 System.out.println(objCar.toString());
4 objcar.drive();
line 4-drive() is not defined in class Object
line 3-toString() is not defined in class SimpleCar
X
line 1-class Object is not defined
O line 2-a SimpleCar reference cannot be assigned to an Object reference
Transcribed Image Text:Which lines cause a compile error? public class Vehicle { protected String name; private int ID; public setID(int pID) {...} } public class Car extends Vehicle ( private int siles; public Car() { miles = 145; setID(99); ID - 47; nane - "Honda"; 2 } O the erro Oline 3 only O lines 1 and 3 Olines 3 and 4 Given class SimpleCar, which line has a syntax error? public class SimpleCer { private int odometer; public void drive(int miles) { odometer odometer + miles; } 1 Object objCar; 2 objCar new SimpleCar(); 3 System.out.println(objCar.toString()); 4 objcar.drive(); line 4-drive() is not defined in class Object line 3-toString() is not defined in class SimpleCar X line 1-class Object is not defined O line 2-a SimpleCar reference cannot be assigned to an Object reference
Which is true glyan classes Boat and Car both derived from Vehicle?
ution is not an option
O a Vehicle reference can be automatically converted to Boat reference
a Boat reference can be automatically converted to Vehicle reference
a Boat reference can be automatically converted to Car reference
Which of the following relationships depicts an is-a relationship?
School - Classroom
O Building - School
Classroom - Students
Stunts Parents
Your answer
Transcribed Image Text:Which is true glyan classes Boat and Car both derived from Vehicle? ution is not an option O a Vehicle reference can be automatically converted to Boat reference a Boat reference can be automatically converted to Vehicle reference a Boat reference can be automatically converted to Car reference Which of the following relationships depicts an is-a relationship? School - Classroom O Building - School Classroom - Students Stunts Parents Your answer
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 8 steps with 8 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY