User FAQs

If you have a question, please send it to us.

1) Can you describe the concept of Generics ?
Generics provide type-safety to your class at compile-time
Generics makes it possible to reuse your code classes with different data types.

2) What does the following syntax mean ?

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.

3) What is a Generic Delegate ?
There are three different types of generic delegate.
System.Action - can include 0 to 16 input parameters, no return type
System.Func - can include 0 to 16 input parameters and one return type

System.Func<string, string> MyDelegate = MyMethod; 
public static string MyMethod(string inputstring)
{ return ""; }

System.Predicate - can verify a certain criteria and return a boolean value

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