Generic Methods

These are declared with a type parameter

Method_Name<T> (System.Generics.List<T> mylist) 

This is an example of a Generic Method Definition.
The "T" is a type parameter that is used as a placeholder for any type.
This data type can be specified when the method is called.



protected T Method_Name<T>(System.Func<bool, T> Method_ToRun, string Arg1) 
{
   return Method_ToRun(false)
}



© 2024 Better Solutions Limited. All Rights Reserved. © 2024 Better Solutions Limited TopPrevNext