1.

Choose the method defined by MemberInfo.(a) GetCustomAttributes()(b) IsDefined()(c) GetCustomeAttributesData()(d) All of the mentionedThis question was addressed to me in an online interview.I would like to ask this question from Introduction of Reflections topic in division Reflections, Multithreaded Programming, Collection Classes and Mathematical Functions of C#

Answer»

The CORRECT option is (d) All of the mentioned

Best explanation: MemberInfo includes two ABSTRACT methods: GetCustomAttributes( ) and IsDefined( ). These both relate to attributes. The first obtains a list of the custom attributes associated with the invoking object. The second DETERMINES if an attribute is defined for the invoking object. The .NET Framework Version 4.0 adds a method CALLED GetCustomAttributesData(), which returns information about custom attributes.



Discussion

No Comment Found

Related InterviewSolutions