Microsoft
MB-500 · Question #214
A company uses Dynamics 365 Finance. You implement an abstract class named Car. The Car class has the following: - A real member called weight that is used to store the weight of the car. - An…
The correct answer is A. class BigCar extends Car { void new(real _weight) { weight = _weight; } public real getweight(). Weight is not assigned in Car class to assign value we need to wrap new method.
Develop business logic
Question
A company uses Dynamics 365 Finance. You implement an abstract class named Car. The Car class has the following: - A real member called weight that is used to store the weight of the car. - An abstract getWeight method that returns the value of the weight member. The Car class code is: You must create a child class named BigCar. You need to implement the Car class by using the BigCar child class. Which code segment should you use?
Options
- Aclass BigCar extends Car { void new(real _weight) { weight = _weight; } public real getweight()
- Bclass BigCar implements Car { void new(real _weight) { weight = _weight; } public real getweight()
- Cclass BigCar extends car { public real getWeight() { return weight; }}
- Dclass BigCar : car { void new(real _weight) { weight = _weight; } public real getweight() { return
How the community answered
(30 responses)- A83% (25)
- B10% (3)
- C3% (1)
- D3% (1)
Explanation
Weight is not assigned in Car class to assign value we need to wrap new method.
Topics
#abstract class#class inheritance#extends keyword#X++ OOP
Community Discussion
No community discussion yet for this question.