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;
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...
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](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F36b06aee-7e2c-4bb6-b9e4-92cb1ab592c2%2Fae8246c8-72f0-418b-bb99-06aeab0c2f83%2F7s3qo0k_processed.jpeg&w=3840&q=75)
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](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F36b06aee-7e2c-4bb6-b9e4-92cb1ab592c2%2Fae8246c8-72f0-418b-bb99-06aeab0c2f83%2F0oimi9wh_processed.jpeg&w=3840&q=75)
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
![](/static/compass_v2/shared-icons/check-mark.png)
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 8 steps with 8 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
Recommended textbooks for you
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
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…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
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)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
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…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
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)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
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](https://www.bartleby.com/isbn_cover_images/9781337093422/9781337093422_smallCoverImage.gif)
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
![Prelude to Programming](https://www.bartleby.com/isbn_cover_images/9780133750423/9780133750423_smallCoverImage.jpg)
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
![Sc Business Data Communications and Networking, T…](https://www.bartleby.com/isbn_cover_images/9781119368830/9781119368830_smallCoverImage.gif)
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY