exam questions

Exam MB-500 All Questions

View all questions & answers for the MB-500 exam

Exam MB-500 topic 3 question 53 discussion

Actual exam question from Microsoft's MB-500
Question #: 53
Topic #: 3
[All MB-500 Questions]

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?

  • A. class BigCar extends Car { void new(real _weight) { weight = _weight; } public real getweight() { return weight; }}
  • B. class BigCar implements Car { void new(real _weight) { weight = _weight; } public real getweight() { return weight; }}
  • C. class BigCar extends car { public real getWeight() { return weight; }}
  • D. class BigCar : car { void new(real _weight) { weight = _weight; } public real getweight() { return weight; }}
Show Suggested Answer Hide Answer
Suggested Answer: A 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
_Test
Highly Voted 1 year, 3 months ago
A is correct because with option C it is not possible to assign a value to variable weight. It does not make sense to declare a variable without using it.
upvoted 8 times
...
abhig535
Most Recent 3 weeks, 6 days ago
Selected Answer: A
A is correct because: 1. An abstract class needs to be extended not implemented, so options B and D are out. 2. A constructor is needed to initialize the weight field so option C is out. 3. Syntax wise, abstract class requires method to be overriden.
upvoted 1 times
globeearth
3 weeks ago
good description. Agreed.
upvoted 1 times
...
...
2d4d146
3 months, 2 weeks ago
Selected Answer: A
A is correct because weight is not assigned in Car class to assign value we need to add a new method
upvoted 1 times
...
Ali20
9 months, 2 weeks ago
Selected Answer: A
A is correct because: parent class name is Car but in C the parent class name is car and method name in parrent class is getweight but in C is getWeight
upvoted 2 times
globeearth
4 weeks ago
Agreed
upvoted 1 times
...
...
lamawehbe
11 months, 3 weeks ago
A is correct because the parent class name is Car but in C the parent class name is car
upvoted 3 times
...
deepakkb
1 year, 4 months ago
C is correct. Because A has new method with parameter. This will be a compile error.
upvoted 1 times
...
Mohammed_Talha
1 year, 5 months ago
A is correct because weight is not assigned in Car class to assign value we need to wrap new method
upvoted 4 times
...
Hmedd
1 year, 6 months ago
Selected Answer: C
A OR C are Both correct but there is no sens to make new method, am not sure but for me my answer was C
upvoted 1 times
...
DanSinbad
1 year, 8 months ago
Selected Answer: C
does not make sense to call new() method with weight parameter
upvoted 2 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...