Question: Given class ( simplecer , which line has a syntax error? 1 Object objCar; 2 objCar = new SimpleCar ( ) ; 3 system.out. println

Given class (simplecer, which line has a syntax error?1 Object objCar;2 objCar = new SimpleCar();3 system.out. println(objCar.tostring());4 objcar.drive();line 2- a SimpleCar reference cannot be assigned to an Object referenceline 4- drive() is not defined ifrclass Objectline 3- toString() is not defined in class SimpleCarline 1- class Object is not defined
Given class ( simplecer , 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 Programming Questions!