Reflection MCQs

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 4

REFLECTION IN .

NET
Multiple choice questions

1. What can assembly do?

a. Define and load assembly

b. Define assembly

c. Load assembly

2. Which of these is true about assembly that contains the code that is currently executing

a. var assembly = System.Reflection.Assembly (Type type);

b. var assembly = System.Reflection.Assembly.GetAssembly(Type type);

c. var assembly = System.Reflection.Assembly.GetAssembly(Type);

3. How can you load assembly

a. var assembly = System.Replection.Assembly.Load();

b. var assembly = System.Replection.Assembly.Load(string assemblyString);

c. var assembly = System.Replection.Assembly();

4. Type class does

a. class types, enumeration types, type parameters,

b. interface types, array types

c. All of these

5. A TypeInfo instance contains:

a. definition for a Type, and a Type

b. Type

c. definition for a Type,


6. What does BindingFlags do?

a. specifies flags that control binding

b. Delete flags that control binding

c. Update flags that control binding

7. Bitwise combination of its member values is aloowed by:

a. MethodInfo

b. FlagsAttribute

c. Bindingflags

8. Information about the attributes of a member is obytained by

a. MethodInfo

b. FieldInfo

c. MemberInfo

9. Member is a custom member type. It is specified by

a. Event

b. Custom

c. Field

10. Event is a custom member type. It is specified by

a. Event

b. Custom

c. Field

11. Field is a custom member type. It is specified by

a. Event

b. Custom

c. Field
12. Method Specifies that the member is a method, representing a:

a. MethodInfo member

b. MemberInfo member

c. feildInfo member

13. NestedType Specifies that the member is a nested type, extending:

a. MethodInfo member

b. MemberInfo member

c. feildInfo member

14. Property Specifies that the member is a property, representing a :

a. MethodInfo member

b. PropertyInfo member

c. feildInfo member

15. TypeInfo Specifies that the member is a type, representing a :

a. TypeInfo member.

b. PropertyInfo

c. MemberInfo

16. In reflection isSecurityCritical?

a. Yes

b. No

17. How to Get an array that contains the generic type arguments, using the GetGenericArguments
method.

a.Type[] typeParameters = t.GetGenericArguments(type);

b.Type[] typeParameters = t.GetGenericArguments();

c.Type[] typeParameters = t.GetGenericArguments(t);


18. Can you create an instance of generic type?

a. Yes

b. No

19. How can you determine whether type is generic or not?

a. By using IsGenericType

b. By using IsGenericMethod

c. By using MethodInfo

20. From where generic type Parameter might come

a. from an enclosing type,

b. from a generic method

c. Both a&b

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy