In Java - Create an example of all these methods (should all be using the same type of object) - Create a method that as
Posted: Sun Jul 03, 2022 12:01 pm
In Java - Create an example of all these methods (should all beusing the same type of object)
- Create a method that asks the user for input and creates anobject (should start with, public static CarcreateCar(Scanner kb), that would return a newobject)
- Create a method would fill an array with objects (themethod should start with, public static Car[]fillArray(Scanner D, int total), with Dbeing the Scanner object and total being thelength of the array)
- Create a method that would print out the array of objects fromabove (Should start with, public static void printCars(Car[] array, PrintStream output))
- Create a method that would create a new objects array from theold array, plus one, and add a new object in the last index of thenew array.(Should start with, public static Car[]addCar(Car[] array, Car newCar, withnewCar representing the object that would be addedto the array)
- Create a method that asks the user for input and creates anobject (should start with, public static CarcreateCar(Scanner kb), that would return a newobject)
- Create a method would fill an array with objects (themethod should start with, public static Car[]fillArray(Scanner D, int total), with Dbeing the Scanner object and total being thelength of the array)
- Create a method that would print out the array of objects fromabove (Should start with, public static void printCars(Car[] array, PrintStream output))
- Create a method that would create a new objects array from theold array, plus one, and add a new object in the last index of thenew array.(Should start with, public static Car[]addCar(Car[] array, Car newCar, withnewCar representing the object that would be addedto the array)