Complete the code to get the type of the class using reflection.
Type type = typeof([1]);Using typeof(MyClass) gets the Type object for the class MyClass.
Complete the code to get the MethodInfo object for the method named "Calculate".
MethodInfo method = type.GetMethod([1]);The method name must be passed as a string, so use "Calculate".
Fix the error in invoking the method using reflection.
object result = method.Invoke([1], null);When invoking an instance method, you must pass the instance object (here this) as the first argument.
Fill both blanks to create a dictionary of method names and their return types using reflection.
var methods = type.GetMethods();
var dict = new Dictionary<string, Type> { { [1], [2] } };Use methods[0].Name as the key and methods[0].ReturnType as the value for the dictionary entry.
Fill all three blanks to filter methods with no parameters and create a dictionary of their names and return types.
var filtered = methods.Where(m => m.GetParameters().Length [1] 0); var dict = filtered.ToDictionary(m => m.[2], m => m.[3]);
Use == to check for zero parameters, then use Name and ReturnType to create the dictionary.