Intermediate
C#
Q47 / 100
What are extension methods in C#?
Correct! Well done.
Incorrect.
The correct answer is B) Static methods in a static class that add methods to existing types without modifying them, called as if they were instance methods
B
Correct Answer
Static methods in a static class that add methods to existing types without modifying them, called as if they were instance methods
Explanation
static int WordCount(this string s) => s.Split().Length; allows "Hello World".WordCount(). LINQ methods are extension methods on IEnumerable.
Progress
47/100