Question: Given class ( simplecan , which line has a syntax error? public class simplecar private int odometer; public void drive ( int miles ) (

Given class (simplecan, which line has a syntax error?
public class simplecar
private int odometer;
public void drive(int miles)(
odometer = odometer + miles;
?
}
1 Object objcar;
2 abjcar = new SimpleCar();
3 System.out.printin(objCar,tostring());
4 objcar.arive();
line 3- tostring() is not defined in class SimpleCar
line 1- class Object is not defined
line 2- a SimpleCar reference cannot be assigned to an Object reference
line 4- drive() is not defined in class Object
 Given class (simplecan, which line has a syntax error? public class

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!