Last active
March 23, 2019 03:44
-
-
Save nodlAndHodl/0b760b6d988b0081206d9f46ac53e1b4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class GenericClass<T> where T | |
{ | |
private T _genericField; | |
public T genericProperty { get; set; } | |
public GenericClass(T value) | |
{ | |
_genericField = value; | |
} | |
public T genericMethod(T genericParameter) | |
{ | |
this.genericProperty = genericParameter; | |
Console.WriteLine("Parameter type: {0}, value: {1}", typeof(T).ToString(), genericParameter); | |
Console.WriteLine("Return type: {0}, value: {1}", typeof(T).ToString(), this._genericField); | |
return this._genericField; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment