Examveda

In C#, what is the syntax to define a constructor for a class named Car that takes parameters make and model?

A. Car(string make, string model) { }

B. Car = (string make, string model) => { }

C. void Car(string make, string model) { }

D. public Car(string make, string model) { }

Answer: Option D


Join The Discussion

Related Questions on Classes and Objects in C Sharp