Question: 7. There are four errors in the given program. Underline any three errors and correct them SECTION - C (25=10 MARKS ) Answer any TWO
7. There are four errors in the given program. Underline any three errors and correct them SECTION - C (25=10 MARKS ) Answer any TWO Questions. Each Question carries FIVE Marks. 8. (a) Create a class named 'Car' with two attribute carBrand and carID. You should also implement: - Empty constructor and constructor with arguments(parameters) - Setter methods \& getter methods - Override the method toString0) to print carBrand-carID (b) Create the main class that has the main method: - In the main method, create three objects from the class Car and store them. in a normal array of a size 3 and data type Car. - Use for loop to print all the elements of the array using toString(0) method
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
