Tuesday, November 24, 2009

A method which can return multiple datatypes in C#

Simple solution to achive this.




private void button1_Click(object sender, EventArgs e)

{




String test = TestFunction("Mahesh Bagul.");




Console.WriteLine(test);




int val = TestFunction(10);




Console.WriteLine(val);

}







private T TestFunction<T>(T val)

{




return val;


//For a while I just return same value.

}

Monday, November 23, 2009

My First Blog

Hi Friends,
This is my first blog.
And it's nice to see you here...