Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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.
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 ; i1 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started