// ===++===
//
// OrtizOL
//
// ===--===
/*============================================================
//
// Clase: ClaseGenerica.cs
//
// Propósito: Uso de restricción de parámetros de tipo.
//
============================================================*/
using System;
namespace Articulos.Cap03
{
internal class A { }
internal class B : A { }
internal class C : B { }
internal class D : Object { }
internal class ClaseGenerica<T> where T:A
{
// Cuerpo de implementación
}
internal class PruebaClaseGenerica
{
public static void Main()
{
ClaseGenerica<A> a = new ClaseGenerica<A>();
ClaseGenerica<B> b = new ClaseGenerica<B>();
ClaseGenerica<C> c = new ClaseGenerica<C>();
}
}
}
Ly8gPT09Kys9PT0KLy8KLy8gICAgT3J0aXpPTAovLwovLyA9PT0tLT09PQovKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQovLwovLyBDbGFzZTogQ2xhc2VHZW5lcmljYS5jcwovLwovLyBQcm9ww7NzaXRvOiBVc28gZGUgcmVzdHJpY2Npw7NuIGRlIHBhcsOhbWV0cm9zIGRlIHRpcG8uCi8vCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCgp1c2luZyBTeXN0ZW07CgpuYW1lc3BhY2UgQXJ0aWN1bG9zLkNhcDAzCnsKICAgIGludGVybmFsIGNsYXNzIEEgeyB9CiAgICAKICAgIGludGVybmFsIGNsYXNzIEIgOiBBIHsgfQogICAgCiAgICBpbnRlcm5hbCBjbGFzcyBDIDogQiB7IH0KICAgIAogICAgaW50ZXJuYWwgY2xhc3MgRCA6IE9iamVjdCB7IH0KCiAgICBpbnRlcm5hbCBjbGFzcyBDbGFzZUdlbmVyaWNhPFQ+IHdoZXJlIFQ6QQogICAgewogICAgICAgIC8vIEN1ZXJwbyBkZSBpbXBsZW1lbnRhY2nDs24KICAgIH0KICAgIAogICAgaW50ZXJuYWwgY2xhc3MgUHJ1ZWJhQ2xhc2VHZW5lcmljYQogICAgewogICAgICAgIHB1YmxpYyBzdGF0aWMgdm9pZCBNYWluKCkKICAgICAgICB7CiAgICAgICAgICAgIENsYXNlR2VuZXJpY2E8QT4gYSA9IG5ldyBDbGFzZUdlbmVyaWNhPEE+KCk7CiAgICAgICAgICAgIENsYXNlR2VuZXJpY2E8Qj4gYiA9IG5ldyBDbGFzZUdlbmVyaWNhPEI+KCk7CiAgICAgICAgICAgIENsYXNlR2VuZXJpY2E8Qz4gYyA9IG5ldyBDbGFzZUdlbmVyaWNhPEM+KCk7CiAgICAgICAgfQogICAgfQp9