Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
generic hierarchy1
//Title of this code //Rextester.Program.Main is the entry point for your code. Don't change it. //Compiler version 4.0.30319.17929 for Microsoft (R) .NET Framework 4.5 using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; namespace Rextester { public class Gen<T> { T ob; public Gen(T t) { ob=t; } public T GetOb() { return ob; } } public class Gen2<T,V>:Gen<T> { V ob2; T ob3; public Gen2(T t,V v):base(t) { ob2=v; ob3=t; } public V GetOb2() { return ob2; } public T GetOb3() { return ob3; } } public class Program { public static void Main(string[] args) { Gen2<int,double> g1=new Gen2<int,double>(10,15.2); Console.WriteLine(g1.GetOb()); Console.WriteLine(g1.GetOb2()); Console.WriteLine(g1.GetOb3()); Gen<Gen2<int,double>>g2=new Gen<Gen2<int,double>>(g1); Console.WriteLine(g2.GetOb().GetOb2()+" "+g2.GetOb().GetOb3()); } } }
run
|
edit
|
history
|
help
0
Override method/function in C#
sdfgjikjuyhtgrfed
my first
Padma narwade
Upgrade
h
Конструктор класса
Command design pattern
Linked List
Problem Name_single_digi