Question: Exercise 2 : Write a constructor in the Car class given below that initializes the brand class field with the string KIA. Call the getBrand

Exercise 2:
Write a constructor in the Car class given below that initializes the brand class field with the string "KIA".
Call the getBrand() method in the main method of the Sample class and store the value of the brand in a variable, and print the value.
Add a SetBrand method and use it in the main program to update the brand to "GMC".
class
 Exercise 2: Write a constructor in the Car class given below

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!