SlideShare a Scribd company logo
1 of 8
Download to read offline
Teacher:Bilal Shehzad
EAD REFLECTION
Presentation Topic:
Reflection(C#)
Prepared For:
Bilal Shahzad
Prepared By:
Nabell (BCSF12M060)
Sheraz Manzoor (BCSF13M009)
Arham Butt (BCSF13M025)
Farhan (BCSF13M058)
Zubair Dar (BCSF13M065)
Video link: https://youtu.be/MC1b3P4Mw3M
PUNJAB UNI COLLEGE OF INFORMATION &
TECHNOLOGY
Teacher:Bilal Shehzad
EAD REFLECTION
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
Teacher:Bilal Shehzad
EAD REFLECTION
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. Which class discovers the attributes of a field and provides
access to field metadata.
a. MemberInfo
b. MethodInfo
c. fieldInfo
17. Which class discovers the attributes of a property and provides
access to property metadata
a. MemberInfo
Teacher:Bilal Shehzad
EAD REFLECTION
b. PropertyInfo
c. fieldInfo
18. Which class allows you to access a given module within a multi-
file assembly.
a. Assembly
b. Module
c. AssemblyName
19. Which class contains information for a given method.
a. Assembly
b. AssemblyName
c. MethodInfo
20. Which class holds information for a given parameter.
a. Assembly
b. Module
c. ParameterInfo
21. GetMethod() returns a
a. System.Reflection.MethodInfo object
b. EventInfo
c .PropertyInfo
22. What is system.reflection namespace hierarchy:
a. System.reflection -> MemberInfo -> Methodbase -> MethodInfo -
> .Net Reflection
b. System.reflection -> MemberInfo -> MethodInfo -> Methodbase -
> .Net Reflection
c. System.reflection -> MethodInfo -> MemberInfo -> Methodbase -
> .Net Reflection
23. The MethodInfo type allows you to obtain the method's return
value and parameter set.
a. True
b. False
24. Does reflection allows late binding?
Teacher:Bilal Shehzad
EAD REFLECTION
a. Yes
b. No
25. Reflection can also be used to create applications called type
browsers.
a. Yes
b. No
26.To discover information such as a parameter's name, data type,
whether a parameter is an input or output parameter,
a. PropertyInfo
b. ParameterInfo
c. MethodInfo
27.To discover information about custom attributes when you are
working in the reflection-only context of an application domain.
a. constructorInfo
b. Module
c. customerAttributeData
28.Which namespace provide a specialized form of reflection that
enables you to build types at run time.
a. System.reflection
b. System.type
c. System.Reflection.Emit
29.Locating the declaration is called Biding
a. True
b. False
30.How can you load an assembly at run time,
a. Late binding
b. Early binding
Teacher:Bilal Shehzad
EAD REFLECTION
c. Custom binding
31.Type.InvokeMember is used to invoke a member of a type
a. True
b. False
32.Which class is used for overload resolution and argument coercion in
methods.
a. Assembly
b. Binder
c. CustomBinder
33.ChangeType performs argument coercion (type conversion)
a. Yes
b. No
34. All code can use reflection to perform the following tasks:
a. Enumerate types and members, and examine their metadata.
b. Enumerate and examine assemblies and modules.
c. Both a & b
35.In reflection isSecurityCritical?
a. Yes
b. No
36.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);
37.Can you create an instance of generic type?
a. Yes
b. No
Teacher:Bilal Shehzad
EAD REFLECTION
38.How can you determine whether type is generic or not?
a. By using IsGenericType
b. By using IsGenericMethod
c. By using MethodInfo
39.From where generic type Parameter might come
a. from an enclosing type,
b. from a generic method
c. Both a&b
40.Can we
use Type.GetGenericArguments and MethodInfo.GetGenericArgume
nts to obtain an array of Type objects that represent the type
parameters or type arguments of a generic type,
a. Yes
b. No
Teacher:Bilal Shehzad
EAD REFLECTION
Links:
http://www.codeproject.com/Articles/17269/Reflection-
in-C-Tutorial
https://dotnetcademy.net/Learn/4/Pages/1
http://www.tutorialspoint.com/csharp/csharp_reflection.
htm
https://msdn.microsoft.com/en-us/library/mt656691.aspx

More Related Content

Viewers also liked (7)

Dynamic Binding in C# 4.0
Dynamic Binding in C# 4.0Dynamic Binding in C# 4.0
Dynamic Binding in C# 4.0
 
C# Delegates, Events, Lambda
C# Delegates, Events, LambdaC# Delegates, Events, Lambda
C# Delegates, Events, Lambda
 
OOP - Benefits and advantages of OOP
OOP - Benefits and advantages of OOPOOP - Benefits and advantages of OOP
OOP - Benefits and advantages of OOP
 
C# Delegates and Event Handling
C# Delegates and Event HandlingC# Delegates and Event Handling
C# Delegates and Event Handling
 
Advanced C#. Part 1
Advanced C#. Part 1Advanced C#. Part 1
Advanced C#. Part 1
 
Advanced C#. Part 2
Advanced C#. Part 2Advanced C#. Part 2
Advanced C#. Part 2
 
C# Exceptions Handling
C# Exceptions Handling C# Exceptions Handling
C# Exceptions Handling
 

Similar to Reflection Mcq's by Zubair Dar

Tổng hợp câu hỏi ôn tập android có đáp án
Tổng hợp câu hỏi ôn tập android có đáp ánTổng hợp câu hỏi ôn tập android có đáp án
Tổng hợp câu hỏi ôn tập android có đáp án
bsb_2209
 
Reflection in java
Reflection in javaReflection in java
Reflection in java
upen.rockin
 
Object-oriented programming 3.pptx
Object-oriented programming 3.pptxObject-oriented programming 3.pptx
Object-oriented programming 3.pptx
Adikhan27
 

Similar to Reflection Mcq's by Zubair Dar (20)

Std 12 computer chapter 8 classes and objects in java important MCQs
Std 12 computer chapter 8 classes and objects in java important MCQsStd 12 computer chapter 8 classes and objects in java important MCQs
Std 12 computer chapter 8 classes and objects in java important MCQs
 
Tổng hợp câu hỏi ôn tập android có đáp án
Tổng hợp câu hỏi ôn tập android có đáp ánTổng hợp câu hỏi ôn tập android có đáp án
Tổng hợp câu hỏi ôn tập android có đáp án
 
Java Programming.pdf
Java Programming.pdfJava Programming.pdf
Java Programming.pdf
 
UGC-NET, GATE and all IT Companies Interview C++ Solved Questions PART - 1
UGC-NET, GATE and all IT Companies Interview C++ Solved Questions PART - 1 UGC-NET, GATE and all IT Companies Interview C++ Solved Questions PART - 1
UGC-NET, GATE and all IT Companies Interview C++ Solved Questions PART - 1
 
Ganesh groups
Ganesh groupsGanesh groups
Ganesh groups
 
Lecturespecial
LecturespecialLecturespecial
Lecturespecial
 
OOP
OOPOOP
OOP
 
Java MCQs.pdf
Java MCQs.pdfJava MCQs.pdf
Java MCQs.pdf
 
C++ Object Oriented Programming
C++  Object Oriented ProgrammingC++  Object Oriented Programming
C++ Object Oriented Programming
 
Oop inheritance
Oop inheritanceOop inheritance
Oop inheritance
 
C# interview questions
C# interview questionsC# interview questions
C# interview questions
 
Reflection in C Sharp
Reflection in C SharpReflection in C Sharp
Reflection in C Sharp
 
hi
hihi
hi
 
Reflection in java
Reflection in javaReflection in java
Reflection in java
 
Inheritance and Interfaces
Inheritance and InterfacesInheritance and Interfaces
Inheritance and Interfaces
 
Spring Certification Questions
Spring Certification QuestionsSpring Certification Questions
Spring Certification Questions
 
Lecture 3 __c_sharp
Lecture 3 __c_sharpLecture 3 __c_sharp
Lecture 3 __c_sharp
 
Pega 7 CSA DUMPS,pega csa dumps
Pega 7 CSA DUMPS,pega csa dumps Pega 7 CSA DUMPS,pega csa dumps
Pega 7 CSA DUMPS,pega csa dumps
 
Java Reflection Concept and Working
Java Reflection Concept and WorkingJava Reflection Concept and Working
Java Reflection Concept and Working
 
Object-oriented programming 3.pptx
Object-oriented programming 3.pptxObject-oriented programming 3.pptx
Object-oriented programming 3.pptx
 

Recently uploaded

Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSSpellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
AnaAcapella
 

Recently uploaded (20)

Details on CBSE Compartment Exam.pptx1111
Details on CBSE Compartment Exam.pptx1111Details on CBSE Compartment Exam.pptx1111
Details on CBSE Compartment Exam.pptx1111
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
Play hard learn harder: The Serious Business of Play
Play hard learn harder:  The Serious Business of PlayPlay hard learn harder:  The Serious Business of Play
Play hard learn harder: The Serious Business of Play
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSSpellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
 
Introduction to TechSoup’s Digital Marketing Services and Use Cases
Introduction to TechSoup’s Digital Marketing  Services and Use CasesIntroduction to TechSoup’s Digital Marketing  Services and Use Cases
Introduction to TechSoup’s Digital Marketing Services and Use Cases
 
OS-operating systems- ch05 (CPU Scheduling) ...
OS-operating systems- ch05 (CPU Scheduling) ...OS-operating systems- ch05 (CPU Scheduling) ...
OS-operating systems- ch05 (CPU Scheduling) ...
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptx
 
How to Add a Tool Tip to a Field in Odoo 17
How to Add a Tool Tip to a Field in Odoo 17How to Add a Tool Tip to a Field in Odoo 17
How to Add a Tool Tip to a Field in Odoo 17
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
 
dusjagr & nano talk on open tools for agriculture research and learning
dusjagr & nano talk on open tools for agriculture research and learningdusjagr & nano talk on open tools for agriculture research and learning
dusjagr & nano talk on open tools for agriculture research and learning
 
How to Manage Call for Tendor in Odoo 17
How to Manage Call for Tendor in Odoo 17How to Manage Call for Tendor in Odoo 17
How to Manage Call for Tendor in Odoo 17
 
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17
 
What is 3 Way Matching Process in Odoo 17.pptx
What is 3 Way Matching Process in Odoo 17.pptxWhat is 3 Way Matching Process in Odoo 17.pptx
What is 3 Way Matching Process in Odoo 17.pptx
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)
 
AIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.pptAIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.ppt
 
VAMOS CUIDAR DO NOSSO PLANETA! .
VAMOS CUIDAR DO NOSSO PLANETA!                    .VAMOS CUIDAR DO NOSSO PLANETA!                    .
VAMOS CUIDAR DO NOSSO PLANETA! .
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
 

Reflection Mcq's by Zubair Dar

  • 1. Teacher:Bilal Shehzad EAD REFLECTION Presentation Topic: Reflection(C#) Prepared For: Bilal Shahzad Prepared By: Nabell (BCSF12M060) Sheraz Manzoor (BCSF13M009) Arham Butt (BCSF13M025) Farhan (BCSF13M058) Zubair Dar (BCSF13M065) Video link: https://youtu.be/MC1b3P4Mw3M PUNJAB UNI COLLEGE OF INFORMATION & TECHNOLOGY
  • 2. Teacher:Bilal Shehzad EAD REFLECTION 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
  • 3. Teacher:Bilal Shehzad EAD REFLECTION 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. Which class discovers the attributes of a field and provides access to field metadata. a. MemberInfo b. MethodInfo c. fieldInfo 17. Which class discovers the attributes of a property and provides access to property metadata a. MemberInfo
  • 4. Teacher:Bilal Shehzad EAD REFLECTION b. PropertyInfo c. fieldInfo 18. Which class allows you to access a given module within a multi- file assembly. a. Assembly b. Module c. AssemblyName 19. Which class contains information for a given method. a. Assembly b. AssemblyName c. MethodInfo 20. Which class holds information for a given parameter. a. Assembly b. Module c. ParameterInfo 21. GetMethod() returns a a. System.Reflection.MethodInfo object b. EventInfo c .PropertyInfo 22. What is system.reflection namespace hierarchy: a. System.reflection -> MemberInfo -> Methodbase -> MethodInfo - > .Net Reflection b. System.reflection -> MemberInfo -> MethodInfo -> Methodbase - > .Net Reflection c. System.reflection -> MethodInfo -> MemberInfo -> Methodbase - > .Net Reflection 23. The MethodInfo type allows you to obtain the method's return value and parameter set. a. True b. False 24. Does reflection allows late binding?
  • 5. Teacher:Bilal Shehzad EAD REFLECTION a. Yes b. No 25. Reflection can also be used to create applications called type browsers. a. Yes b. No 26.To discover information such as a parameter's name, data type, whether a parameter is an input or output parameter, a. PropertyInfo b. ParameterInfo c. MethodInfo 27.To discover information about custom attributes when you are working in the reflection-only context of an application domain. a. constructorInfo b. Module c. customerAttributeData 28.Which namespace provide a specialized form of reflection that enables you to build types at run time. a. System.reflection b. System.type c. System.Reflection.Emit 29.Locating the declaration is called Biding a. True b. False 30.How can you load an assembly at run time, a. Late binding b. Early binding
  • 6. Teacher:Bilal Shehzad EAD REFLECTION c. Custom binding 31.Type.InvokeMember is used to invoke a member of a type a. True b. False 32.Which class is used for overload resolution and argument coercion in methods. a. Assembly b. Binder c. CustomBinder 33.ChangeType performs argument coercion (type conversion) a. Yes b. No 34. All code can use reflection to perform the following tasks: a. Enumerate types and members, and examine their metadata. b. Enumerate and examine assemblies and modules. c. Both a & b 35.In reflection isSecurityCritical? a. Yes b. No 36.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); 37.Can you create an instance of generic type? a. Yes b. No
  • 7. Teacher:Bilal Shehzad EAD REFLECTION 38.How can you determine whether type is generic or not? a. By using IsGenericType b. By using IsGenericMethod c. By using MethodInfo 39.From where generic type Parameter might come a. from an enclosing type, b. from a generic method c. Both a&b 40.Can we use Type.GetGenericArguments and MethodInfo.GetGenericArgume nts to obtain an array of Type objects that represent the type parameters or type arguments of a generic type, a. Yes b. No