Question: 4G 5:24 ...ythos.s3-ap-southeast-2.amazonaws.com 4. What is the default value of: An object that has not been initialized? (1 mark) An int? (1 mark) For a

4G 5:24 ...ythos.s3-ap-southeast-2.amazonaws.com 4. What is the default value of: An object that has not been initialized? (1 mark) An int? (1 mark) 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) 6. For the class you created in the question above: .Write the code to create an instance of a Car. (2 marks) Declare and initialise an HashSet and insert the Car you created. (4 marks) 7. What is the scope of a constructor parameter? (2 marks) x Given the following array: intl numbers = {1, 3.2.4. 2): Write a for loop to loop through the array and print out cach number on a separate line. (2 marks) Write a for each loop to loop through the array and print out each number on a separate line. (2 marks) . What keyword is used to call a superclass constructor? (2 marks) 10 What is an overloaded constructor? (2 marks) 11. Given the code below: ArrayList
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
