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 driveint miles
odometer odometer miles;
Object objcar;
abjcar new SimpleCar;
System.out.printinobjCartostring;
objcar.arive;
line tostring is not defined in class SimpleCar
line class Object is not defined
line a SimpleCar reference cannot be assigned to an Object reference
line drive is not defined in class Object
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
