Question: 1 4 1 point Given class SimpleCar, which line has a syntax error? public class simpleCar { private int odometer; public void drive ( int

14
1 point
Given class SimpleCar, which line has a syntax error?
public class simpleCar {
private int odometer;
public void drive(int miles){
odometer = odometer + miles;
}
}
1 Object objcar;
objCar = new SimpleCar();
System.out.println(objCar.tostring());
objcar.drive();
line 2- a SimpleCar reference cannot be assigned to an Object reference line 3- toString() is not defined in class SimpleCar
line 1- class Object is not defined
line 4-drive() is not defined in class Object
Clear my selection
 14 1 point Given class SimpleCar, which line has a syntax

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!