A parameterized constructor accepts arguments to initialize an object with specific values. Car(string m, int y) : model(m), year(y) { } lets you write Car myCar("Tesla", 2024); instead of creating an empty object and setting values later.
Use an initializer list to assign parameters to member variables. Car(string m) : model(m) { } is more efficient than Car(string m) { model = m; } .
You can provide multiple parameterized constructors through overloading: Car(string model); Car(string model, int year); Car(string model, int year, string color);