Skip to main content

Posts

Showing posts with the label generic classes and methods in c#

generic classes and methods in c#

Generic  is a type parameter technique. Using this technique we write a class, or methods that can work any data type that means user defines data type or system define data type. It is type-safe . using System.Collections.Generic; Example of Generic Type   namespace Generics   {      public class GeneRicType     {         public T _value;         public GeneRicType(T t)         {             this ._value = t;         public void Input()         {             Console .WriteLine( this ._value);         }     public class Program     { ...