Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed
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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

MySQL Crash Course A Hands On Introduction To Database Development

Authors: Rick Silva

1st Edition

1718503008, 978-1718503007

More Books

Students also viewed these Databases questions