C# GenericsGeneric is a concept that allows us to define classes and methods with placeholder. C# compiler replaces these placeholders with specified type at compile time. The concept of generics is used to create general purpose classes and methods. o define generic class, we must use angle <> brackets. The angle brackets are used to declare a class or method as generic type. In the following example, we are creating generic class that can be used to deal with any type of data. C# Generic class exampleOutput: This is generic class 101 I C# allows us to create generic methods also. In the following example, we are creating generic method that can be called by passing any type of argument. Generic Method ExampleOutput: This is generic method 101 I Next TopicC# Delegates |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India