Question 1 of 30
In a software development project, a base class named `Vehicle` has properties such as `speed` and `capacity`. A derived class named `Car` inherits from `Vehicle` and adds a property called `numberOfDoors`. If an instance of `Car` is created with a speed of 120 km/h, a capacity of 5 passengers, and 4 doors, what will be the output when the `displayInfo()` method, which is defined in the `Vehicle` class and overridden in the `Car` class, is called? Assume the `displayInfo()` method in `Vehicle` returns a string formatted as \"Speed: {speed}, Capacity: {capacity}\" and the overridden method in `Car` returns \"Speed: {speed}, Capacity: {capacity}, Number of Doors: {numberOfDoors}\".
"Speed: 120 km/h, Capacity: 5, Number of Doors: 4"
"Speed: 120 km/h, Capacity: 5"
"Speed: 120, Capacity: 5, Number of Doors: 4"
"Speed: 120 km/h, Capacity: 5, Number of Doors: 5"

Preparing for Microsoft 98-361 Software Development Fundamentals? Now land the interview.

73% of qualified candidates get rejected because of weak resumes. Build an ATS-optimized, recruiter-ready resume in under 5 minutes - free to start.

Build My Resume Free