I have the following script:
class Addition{ public Addition(int a){ a=5; } public static int add(int a,int b) {return a+b; } }
I call add to another class:
string s="add"; typeof(Addition).GetMethod(s).Invoke(null, new object[] {10,12})
I need a way similar to the reflection expression described above to create a new object of type Addition using Addition(int a)
So, I have the line s= "Addition" , I want to create a new object using reflection.
Is it possible?
source share