exam questions

Exam MB-500 All Questions

View all questions & answers for the MB-500 exam

Exam MB-500 topic 3 question 18 discussion

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

Note: This question is part of a series of questions that present the same scenario. Each question in the series contains a unique solution that might meet the stated goals. Some question sets might have more than one correct solution, while others might not have a correct solution.
After you answer a question in this section, you will NOT be able to return to it. As a result, these questions will not appear in the review screen.
You must extend the class SalesLineType and add a new method that returns the day of week for the system's current date as an integer value.
You need to create a class that extends SalesLineType and adds the new method.
Solution: You create the following code:

Does the solution meet the goal?

  • A. Yes
  • B. No
Show Suggested Answer Hide Answer
Suggested Answer: B 🗳️

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
SiPa
Highly Voted 3 years, 9 months ago
Should be "Yes" ExtensionOf property correct Class naming correct with "_Extension" Method on type "int" and "dayofwk(Date date)" return integer value.
upvoted 9 times
ImranBalti
3 years ago
what about next() in CoC ?
upvoted 1 times
Nkraa
2 years, 11 months ago
You need next() when you are changing the logic of an existing method. In this cas it is a new that is being created. How i know that? look at the method name: extensionmethodDayOfWeek() .
upvoted 1 times
...
...
priyan14
3 years, 3 months ago
The extension suffix is myExtension, so it is wrong. The correct class name should end with _Extension
upvoted 10 times
pinticas
3 years, 2 months ago
This is it, it is about the incorrect suffix.
upvoted 2 times
...
...
...
Anton_Venter
Highly Voted 3 years, 8 months ago
Should be A.
upvoted 5 times
...
Yabad001
Most Recent 6 days, 13 hours ago
Selected Answer: B
Severity Code Description Project Path File Line Suppression State Error The method 'ExtensionMethodDayofWeek' is in a class used for extension methods. The first parameter of a public extension method must be a class or a table indicating what type the method extends. Report (USR) [Report ] C:\AOSService\PackagesLocalDirectory\Bin\XppSource\Report C:\AOSService\PackagesLocalDirectory\Bin\XppSource\Report\AxClass_mySalesLineType_Extension.xpp 3 Error Extension class 'mySalesLineType_Extension' must be static and public or internal. Report (USR) [Report ] C:\AOSService\PackagesLocalDirectory\Bin\XppSource\Report C:\AOSService\PackagesLocalDirectory\Bin\XppSource\Report\AxClass_mySalesLineType_Extension.xpp 1
upvoted 1 times
...
8933e4c
2 months, 3 weeks ago
Selected Answer: B
I prefer B, sice the question is about extending a class, not inheriting a class.
upvoted 1 times
...
shyammo
3 months, 3 weeks ago
The coding is wrong. synatx is fine. Code to get day of the week is wrong.
upvoted 1 times
...
NSIDEV
2 years, 2 months ago
Selected Answer: B
This example is not correct, although the class is decorated by "[extensionOf(...)]" and the name ends with _Extension, theres is the "extends " keyword wich is incorrect in an extension class (extends is only for derivated classes)
upvoted 1 times
...
Evert2
2 years, 2 months ago
I believe someone messed up the questions vs discussion. The discussions are about a different question.
upvoted 5 times
yuri_rusanov
2 years ago
It does indeed seem this way
upvoted 1 times
...
...
Prollyx
2 years, 8 months ago
Selected Answer: B
There is issue with the class name suffix "_myExtension", extension class has to end with "_Extension". Compiler would give you error with this code.
upvoted 2 times
...
pjgallego
2 years, 10 months ago
Selected Answer: B
Correct B
upvoted 1 times
...
faycal
2 years, 11 months ago
Correct is No: suffix of class extension must be “_Extension” otherwise you will get build error.
upvoted 2 times
...
kornetmuse
3 years, 4 months ago
The problem is not about the compilation but about the value obtained. You should never manipulate dateTime to extract the date without applying a timeZone. In this piece of code depending of the time of the day you will not have the same result (unless you're in Great Britain of course :D). So B is the correct answer.
upvoted 1 times
kornetmuse
3 years, 4 months ago
I misplaced my comment. It will be more accurate on the other piece of code like this one. Because here the _myExtension is false.
upvoted 1 times
...
...
Ariston
3 years, 5 months ago
Correct is No: suffix of class extension must be “_Extension” otherwise you will get build error.
upvoted 4 times
...
Shyams2708
3 years, 5 months ago
Correct class naming convention should end with "_Extension" and not "_myExtension". Correct answer is B: No.
upvoted 2 times
...
viking1
3 years, 5 months ago
B - "No". The class name doesn't end in "_Extension"
upvoted 1 times
...
Azat
3 years, 7 months ago
I agree agree with the comments posted above
upvoted 1 times
...
ODARK
3 years, 8 months ago
I agree, also checked, no compilation errors with this code.
upvoted 4 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