exam questions

Exam MB-500 All Questions

View all questions & answers for the MB-500 exam

Exam MB-500 topic 4 question 9 discussion

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

HOTSPOT -
You have the following class definition:

You need to create an extension class and create a new static method in it that converts miles to kilometers and then call the method from another class.
How should you complete the code and call the method? To answer, select the appropriate options in the answer area.
NOTE: Each correct selection is worth one point.
Hot Area:

Show Suggested Answer Hide Answer
Suggested Answer:

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
afw
Highly Voted 4 years, 2 months ago
Naswer should be :final class CustUnitConv_Extension
upvoted 58 times
Ahmed_Hassan
4 years ago
I agree with you
upvoted 4 times
...
...
Tomas1
Highly Voted 3 years, 10 months ago
Correct answer: 1,1
upvoted 20 times
lamawehbe
11 months ago
i agree
upvoted 1 times
...
...
2d4d146
Most Recent 7 months ago
final class CustUnitConv_Extension
upvoted 1 times
...
theCoder1
1 year, 4 months ago
Correct answer: 1,1
upvoted 3 times
...
Prollyx
2 years, 7 months ago
1&1 is correct
upvoted 4 times
...
niko_
2 years, 9 months ago
Correct is 1 and 1
upvoted 3 times
...
Sisb
2 years, 11 months ago
A - _Extension is mandated, class name does not mater A - static method, so can be called ::
upvoted 1 times
...
ET82
3 years, 4 months ago
First option First option
upvoted 3 times
...
pinticas
3 years, 6 months ago
Correct answers are C and A. - C: Because naming convention makes a class name end with *_Extension. - A: Look at it, this second part of the question is a hint about the first (which is C). TEST IT in D365 and you will see this is the correct answer.
upvoted 1 times
LaXavee
3 years, 5 months ago
1- You right in that the class name must end with *_Extension but you forget that the 'C' answer is an static class and that it's not correct for a CoC extension class, so the correct answer is 'A'. 2- And as you said, this is 'A' too.
upvoted 5 times
...
...
Anton_Venter
3 years, 7 months ago
First should be "final class CustUnitConv_Extension" because extension classes can only end in _Extension, the first part of the class name doesn't matter.
upvoted 3 times
...
BuzzZ
3 years, 8 months ago
both should be the 1st answer
upvoted 4 times
...
Pir
3 years, 10 months ago
2nd choice is both answers. Please read question carefully. In first, the extension class should begin with original class name, i.e., UnitConv_MyExtension. CustUnit.. is not original class. Also, second option is correct because it was mentioned that extended class static method should be called.
upvoted 1 times
Bulhy
3 years, 10 months ago
Please, stop misleading other users.. I need to correct you again, because your are wrong here as well. If you extend a class via [ExtensionOf], the extension class you are creating MUST end with "_Extension" suffix and HAS TO be final, these two are the only requirements that will throw error on compilation, if not satisfied! The naming convention is different topic here. We might argue about "CustUnitConv" being correctly named or not, but it is the only correct answer out of given options, that will not thrown an error on compilation. So "final class CustUnitConv_Extension" is correct answer. As of the second box, the answer is marked correctly "var km = UnitConv::MiToKm(62.1371);", since you use the original/extended class "UnitConv" to call a static method (UnitConv::MiToKm).
upvoted 10 times
juozapyne
3 years, 9 months ago
a. does not meet Naming guidelines for extensions https://docs.microsoft.com/en-us/dynamics365/fin-ops-core/dev-itpro/extensibility/class-extensions b. does not meet Class extension model in X++ "Extension classes are final classes that are adorned with the ExtensionOf attribute and that also have a name that has the _Extension suffix. (This restriction on the naming might be removed later.) The name of the extension class is otherwise unimportant. " https://docs.microsoft.com/en-us/dynamics365/fin-ops-core/dev-itpro/extensibility/class-extensions
upvoted 1 times
...
...
Tomas1
3 years, 10 months ago
Wrong, when declaring extension of a class, class name must end with "_extension" postfix How class name begins doesn't matter.
upvoted 8 times
...
...
sadoki9311
4 years, 2 months ago
https://docs.microsoft.com/en-us/dynamics365/fin-ops-core/dev-itpro/extensibility/naming-guidelines-extensions
upvoted 2 times
...
sadoki9311
4 years, 2 months ago
I guess you are right but why?
upvoted 1 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 ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago