PrepAway - Latest Free Exam Questions & Answers

How should you complete the relevant code?

You are developing a class named ExtensionMethods
You need to ensure that the ExtensionMethods class implements the IsUrl() method on string objects.
How should you complete the relevant code? (To answer, drag the appropriate code segments to the
correct locations in the answer area. Each code segment may be used once, more than once, or not at all.
You may need to drag the split bar between panes orscroll to view content.)

Select and Place:

PrepAway - Latest Free Exam Questions & Answers

Answer:

Explanation:

3 Comments on “How should you complete the relevant code?

  1. MarcoJacob says:

    I would say:

    public static class ExtensionMethods
    {
    public static bool IsUrl(this String str)
    {

    Class must be “public” and “static” because method is public and static (static is necessary in case of using as ExtensionMethod) and “this” is necessary to add this Method for all string Objects.




    1



    0

Leave a Reply