KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
public static class MyClass { public static void Print<T>(this T theObject) { Console.WriteLine("The print output is " + theObject.ToString()); } } In the given class I've specified a generic as the type to extend via the this keyword. Being that I've delayed the definition of the type until compile time, how does intellisense (and anything else involved) know what type I am extending? Does C# simply default to the top level System.Object ?
Tags (comma-separated)
Save Edits
Cancel