Reference Type Constraint : Generic Constraint : Generics C# Source Code


Custom Search

C# Source Code » Generics » Generic Constraint »

 

Reference Type Constraint









    

    using System;
    using System.Collections;

    public class Test{
        public static void Main(){
            Z<X> obj2=new Z<X>();
        }
    }

    public class Z<T> where T: class {
        public void Iterate(T data) {
        }
    }
    public class X{
    }


           
       
    
   
  
   







HTML code for linking to this page:

Follow Navioo On Twitter

C# Source Code

 Navioo Generics
» Generic Constraint