Attributes Questions

Practice Attributes MCQs with answers and explanations. Page 1 of 1.

Category
C# Programming
Topic
Attributes
Page
1 / 1
Mode
Practice

Questions

Open any question to view the answer and explanation.

C# attributes: to which program elements can attributes be applied from the following list — Method, Class, Assembly, Namespace, Enum?
Open
View answer
After attributes are applied in a .NET application, which of the following cannot inspect or read those attributes?
Open
View answer
Applying a custom attribute Tested(name, testgrade): which applications are correct for assembly-level and class-level usage?
Open
View answer
Custom attributes in C#: which of the following cannot be a valid attribute target?
Open
View answer
At what phase is the [Serializable] attribute considered by the .NET platform for (de)serialization behavior?
Open
View answer
Choose the correct way to apply a WebService attribute to a class in C# (considering named parameters for Name and Description).
Open
View answer
Custom attribute targets in C#: how do you specify what elements an attribute can be applied to?
Open
View answer
Attributes in C#.NET: which statements are correct about compilation, reflection, and parameters?
Open
View answer
What does the standard C# file AssemblyInfo.cs primarily contain in a typical project?
Open
View answer
C#.NET — Inspecting attributes: at which stages can attributes be examined or queried? Choose all that truly apply: 1) Link-time 2) Compile-time 3) Run-time 4) Design-time (e.g., by tooling in IDEs)
Open
View answer
C#.NET — Pick the correct syntax to apply an attribute to a class (example: Serializable).
Open
View answer
C#.NET — Attributes: identify the correct statement about custom attributes and runtime behavior.
Open
View answer
C#.NET — Applying an attribute to an assembly: choose the correct syntax.
Open
View answer
C#.NET — How can parameters be passed to attributes? Identify the valid approaches.
Open
View answer
C#.NET — AttributeUsage targeting: can a custom attribute be restricted to specific elements only?
Open
View answer

Practice smarter

Solve a few questions daily and revisit weak topics regularly to improve accuracy.