Question: Debug, something goes wrong in my lab. Original code: public class AutoShowroomDriver { public static void main(String[] args) { AutoShowroom showRoom = new AutoShowroom(); showRoom.createCars();
Debug, something goes wrong in my lab.

![{ public static void main(String[] args) { AutoShowroom showRoom = new AutoShowroom();](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f30fbf922e1_31166f30fbf2ebfc.jpg)
![showRoom.createCars(); showRoom.printStatus(); } } class AutoShowroom { public static Car[] cars; public](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f30fc0509ba_31166f30fbfcc943.jpg)
Original code:
public class AutoShowroomDriver { public static void main(String[] args) { AutoShowroom showRoom = new AutoShowroom(); showRoom.createCars(); showRoom.printStatus(); } } class AutoShowroom { public static Car[] cars; public AutoShowroom() { cars = new Car[3]; } public static void createCars() { cars[0] = new Car("BMW", "X7"); cars[1] = new Car("Audi", "A8"); cars[2] = new Car("Mercedes", "GLS"); } public static void printStatus() { System.out.println("Welcome to FIT2099 Showroom"); for(int i=0 ; i
1 03 A3 public class Auto ShowroomDriver { public static void main(String[] args) { 2 3 4 5 6 Auto Showroom showroom = new Auto Showroom(); showRoom.createCars(); 9 showRoom.printStatus(); Create method 'printStatus' in 'AutoShowroom Press Ctrl+Shift+l to open preview 7 8 9 10 } 11 12 13 class Auto Showroom { 14 15 16 17 18 19 20 21 22 23 24 25 public static Car[] cars; public Auto Showroom() { cars = new Car[3]; } public static void createCars() { cars [0] = new Car( make: "BMW", model: "X7"); cars [1] = new Car( make: "Audi", model: "A8"); cars [2] = new Car( make: "Mercedes", model: "GLS"); } public static void printStatus() System.out.println("Welcome to FIT2099 Showroom"); for(int i=0; i Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
