public class Generic<T> { public T Field; } class Program { static void Main(string[ ] args) { Generic<String> g = new Generic<String>(); g.Field = "Hello"; Console.WriteLine(g.Field); } }
public class Generic<T> { public T Field; public void TestSub() { T i = Field + 1; } } class MyProgram { static void Main(string[] args) { Generic<int> gen = new Generic<int>(); gen.TestSub(); } }
public class TestCuriousTab { public void TestSub<M> (M arg) { Console.Write(arg); } } class MyProgram { static void Main(string[] args) { TestCuriousTab tab = new TestCuriousTab(); tab.TestSub("CuriousTab "); tab.TestSub(4.2f); } }
public class MyContainer<T> where T: IComparabte { // Insert code here }
public class MyContainer<T> where T: class, IComparable { //Insert code here }
int i = 10; int j = 10;
int i, j; i = 10 : j = 10;
int i = 10, j = 10;
int i, j = 10;
int i = j = 10;
Comments
There are no comments.Copyright ©CuriousTab. All rights reserved.