Below is the implementation of the Car class and a partially…
Below is the implementation of the Car class and a partially completed Dealership class. Your task is to fill in the missing part (marked as XXXX) to print the car’s ID, model, and brand. // ——————————————-// Car.java// ——————————————-import java.util.Random; public class Car { private int id; private String model; private String brand; public Car(String model, String brand) { this.model = model; this.brand = brand; Random rndGen = new Random(); id = rndGen.nextInt(5000); // Generate a random ID (0 to 4999) } public int getId() { return id; } public String getModel() { return model; } public String getBrand() { return brand; }} // ——————————————-// Dealership.java// ——————————————- public class Dealership { public static void main(String[] args) { Car car = new Car(“Model S”, “Tesla”); // Complete the code to print the car details XXXX }}
Read Details