nerdexam
Microsoft

98-372 · Question #55

Which of the following types of constraints can you apply to a generic? Each correct answer represents a complete solution. Choose all that apply.

The correct answer is B. Base classes C. Interfaces. There are four types of constraints that you can apply to generics, which are as follows: Making them a reference or value type Answer: D is incorrect. You do not need types to have a particular method or property in a Answer: A is incorrect. You cannot use name pattern matching

Understanding Namespaces and Classes

Question

Which of the following types of constraints can you apply to a generic? Each correct answer represents a complete solution. Choose all that apply.

Options

  • AName pattern matching
  • BBase classes
  • CInterfaces
  • DMethod

How the community answered

(43 responses)
  • A
    7% (3)
  • B
    79% (34)
  • D
    14% (6)

Explanation

There are four types of constraints that you can apply to generics, which are as follows: Making them a reference or value type Answer: D is incorrect. You do not need types to have a particular method or property in a Answer: A is incorrect. You cannot use name pattern matching in a generic constraint.

Topics

#generics#type constraints#base class constraint#interface constraint

Community Discussion

No community discussion yet for this question.

Full 98-372 Practice