Don't take the car to the shop!

  • 14
  • Locked
Initialize the wheels field using data from loadWheelNamesFromDB(). Throw an exception if the data is invalid. Hint: if wheels aren't right, then it's not a car! Don't change the signatures.
You can't complete this task, because you're not signed in.
Comments (2)
  • Popular
  • New
  • Old
You must be signed in to leave a comment
Ibrahim
Level 41 , Sheffield, United Kingdom
9 February 2022, 08:34
To ensure your solution validates correctly make sure to throw an exception when: - The array from loadWheelNamesFromDb == 0. - When the array is less than or greater than 4. - If the current value in the array array[i] is not in the enum.
Jurij Thmsn
Level 29 , Flensburg, Germany
29 October 2021, 09:45
The validation is ridiculous here. The Conditions need to be stated more clearly! Make sure that the program works if the loadWheelsFormDB() method returns the wheels in a different order. Also make sure to handle exceptions if the loadWheelsFromDB() method returns an array of a different length.