Зміст курсу
Advanced C# with .NET
1. Introduction to Desktop Development with .NET
Advanced C# with .NET
Implementing Generic Methods
The syntax for creating a Generic Method is as follows:
index.cs
You can have one or more type parameters in a generic method.
We can execute generic methods as follows:
index.cs
Following is a summary of how we can convert a simple Swap
method to a generic method, which can support any data type:
We don't necessarily need to use the type parameters (like T
) for defining the arguments. In fact there can be generic methods with no arguments at all:
index.cs
It is not possible to directly use any kind of operators on arguments or variables defined using generic types:
index.cs
Все було зрозуміло?
Зміст курсу
Advanced C# with .NET
1. Introduction to Desktop Development with .NET
Advanced C# with .NET
Implementing Generic Methods
The syntax for creating a Generic Method is as follows:
index.cs
You can have one or more type parameters in a generic method.
We can execute generic methods as follows:
index.cs
Following is a summary of how we can convert a simple Swap
method to a generic method, which can support any data type:
We don't necessarily need to use the type parameters (like T
) for defining the arguments. In fact there can be generic methods with no arguments at all:
index.cs
It is not possible to directly use any kind of operators on arguments or variables defined using generic types:
index.cs
Все було зрозуміло?