CSharp examples for System:Object
Create Object from Type
using System;//from w w w. j a v a 2s . c om public class Main{ public static object CreateObject(Type type) { object obj2; try { if (type.ToString() == "System.String") { return string.Empty; } obj2 = Activator.CreateInstance(type); } catch (Exception exception) { throw exception; } return obj2; } public static object CreateObject<T>() { return CreateObject(typeof(T)); } }