Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
gen retuen obj
//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 { class NonGen { public int num; public string s; public NonGen() { //NonGen ng=new NonGen(); } public NonGen(int i) { num = i; } public NonGen(int i,string st) { num = i;s=st; } public int GetNum() { return num; } } // A generic derived class. class Gen<T> : NonGen { public T ob; public int j; public Gen<object> ng; public Gen() { ng=new Gen<object>(); } public Gen(T o) { } public Gen(T o, int i) : base (i) { ob = o;j=i; } // Return ob. public T GetOb2() { ng.ob=ob;ng.j=j; return (T)ng.GetOb(); } public T GetOb() { return ob; } } public class Program { public static void Main(string[] args) { // Create a Gen object for string. Gen<string> w = new Gen<string>("Hello", 47); Gen<string> w2 = new Gen<string>(); NonGen n=new NonGen(12,"Oye"); /*Console.Write(w.GetOb() + "_ "); Console.WriteLine(w.GetNum());*/Console.WriteLine(w.GetOb2()); Console.Write(n.num+" "+n.s+" "+w.j); } } }
run
|
edit
|
history
|
help
0
Min max elements swap of the array
testing endpoint
hypotenuse calculator
PayU Lu c#
Validate Norwegian Mobile Numbers
Sample Code
Decimal separator diff
seoituerwoi
UFC 271 LIVE STREAM FREE REDDIT online
https://www.fxp.co.il/showthread.php?t=21125499