Question: Write a method signature for: a. A method called person that does not return anything and has one (1) parameter of type int called age
Write a method signature for: a. A method called person that does not return anything and has one (1) parameter of type int called age and one (1) parameter of type String called name (1 mark) b. A method called carType that returns a String and has no parameters (1 mark) 2.Write a sample Java method call for each of the method signatures you created in the question above. (2 marks) 3.For a class named Car: Create the class and add 2 (two) instance variables that will hold the car's colour (String) and number of doors (int). (2 marks) Write a constructor which initializes the instance variables you created in the section above. (2 marks) Write an accessor method and a mutator method for the field that will hold the car's colour. (2 marks)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
