Question: Question 5 Given class SimpleCar, which line has a syntax error? 1 Object objCar;objCar = new SimpleCar ( ) ;System - out - println (

Question 5
Given class SimpleCar, which line has a syntax error?1 Object objCar;objCar = new SimpleCar();System-out-println(objCar.toString());4 objCar-drive();
line 1- class Object is not defined
line 2- a SimpleCar reference cannot be assigned to an Object reference
line 3- toString() is not defined in class SimpleCar
line 4- drive() is not defined in class Object
Question 5 Given class SimpleCar, which line has

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 Programming Questions!