C# Programming - Attributes - Discussion

Discussion Forum : Attributes - General Questions (Q.No. 6)
6.
Which of the following statements are correct about Attributes used in C#.NET?
If there is a custom attribute BugFixAttribute then the compiler will look ONLY for the BugFix attribute in the code that uses this attribute.
To create a custom attribute we need to create a custom attribute structure and derive it from System.Attribute.
To create a custom attribute we need to create a class and implement IAttribute interface in it.
If a BugFixAttribute is to receive three parameters then the BugFixAttribute class should implement a zero-argument constructor.
The CLR can change the behaviour of the code depending upon the attributes applied to it.
Answer: Option
Explanation:
No answer description is available. Let's discuss.
Discussion:
1 comments Page 1 of 1.

Raman said:   8 years ago
Option 1: the compiler is not looking only one attribute. It looks for other attributes as well. So its false
Option 2: For creating attribute A class is required to implement Attribute So it's false
Option 3: I have not found IAttribute Class :) It should be Attribute Class. So it's false
Option 4: It requires a parameter constructor to set attribute values. So its false
Option 5: E.g Applying XML serialisation Attribute can change the behaviour of object serialisation. So it's true.

Post your comments here:

Your comments will be displayed after verification.