C# - Attributes Questions and Answers
Practice ModeShowing 10 of 38 questions
Q1
The [Serializable()] attribute gets inspected at
Answer: Option B
Q2
Which of the following are correct ways to specify the targets for a custom attribute?
Answer: Option D
Q3
Which of the following are correct ways to pass a parameter to an attribute?
By value
By reference
By address
By position
By name
Answer: Option C
Q4
Which of the following statements are correct about inspecting an attribute in C#.NET?
An attribute can be inspected at link-time.
An attribute can be inspected at compile-time.
An attribute can be inspected at run-time.
An attribute can be inspected at design-time.
Answer: Option A
Q5
Which of the following statements are correct about Attributes used in C#.NET?
Answer: Option
Q6
Which of the following statements are correct about Attributes in C#.NET?
On compiling a C#.NET program the attibutes applied are recorded in the metadata of the assembly.
On compilation all the attribute's tags are deleted from the program.
It is not possible to create custom attributes..
The attributes applied can be read from an assembly using Reflection class.
An attribute can have parameters.
Answer: Option C
Q7
Which of the following correctly describes the contents of the filename AssemblyInfo.cs?
Answer: Option C
Q8
It possible to create a custom attribute that can be applied only to specific programming element(s) like ____ .
Answer: Option C
Q9
Which of the following CANNOT be a target for a custom attribute?
Answer: Option
Q10
Once applied which of the following CANNOT inspect the applied attribute?
Answer: Option B