You can pass an object array to Activator.CreateInstance if you have more than one parameter.

// With a constructor such as MyClass(int, int, string)
Activator.CreateInstance(typeof(MyClass),newobject[]{1,2,"Hello World"});Typetype=typeof(someObject);varinstance=Activator.CreateInstance(type);

For a generic type

The MakeGenericType method turns an open generic type (like List<>) into a concrete type (like List) by applying type arguments to it.

// generic List with no parameters
TypeopenType=typeof(List<>);// To create a List<string>
Type[]tArgs={typeof(string)};Typetarget=openType.MakeGenericType(tArgs);// Create an instance - Activator.CreateInstance will call the default constructor.
// This is equivalent to calling new List<string>().
List<string>result=(List<string>)Activator.CreateInstance(target);

The List<> syntax is not permitted outside of a typeof expression.

Without Activator class

Using new keyword (will do for parameterless constructors)

TGetInstance<T>()whereT:new(){Tinstance=newT();returninstance;}

Using Invoke method

// Get the instance of the desired constructor (here it takes a string as a parameter).
ConstructorInfoc=typeof(T).GetConstructor(new[]{typeof(string)});// Don't forget to check if such constructor exists
if(c==null)thrownewInvalidOperationException(string.Format("A constructor for type '{0}' was not found.",typeof(T)));Tinstance=(T)c.Invoke(newobject[]{"test"});

Using Expression trees

Expression trees represent code in a tree-like data structure, where each node is an expression. As MSDN explains:

Expression is a sequence of one or more operands and zero or more operators that can be evaluated to a single value, object, method, or namespace. Expressions can consist of a literal value, a method invocation, an operator and its operands, or a simple name. Simple names can be the name of a variable, type member, method parameter, namespace or type.