C# Test

Exam Type: | MCQ Skill Test |
Questions Type: | Multiple Choice Questions |
Total Questions: | 40 |
Time Limit: | 15 Minutes |
Last Update | April, 2025 |



Text Detail
C# linkedin Quiz answers
In which of these situations are interfaces better than abstract classes
- Interfaces are a legacy of older versions of C#, and are interchangeable with the newer abstract class feature.
- You should use both an interface and an abstract class when defining any complex object.
- When you need a list of capabilities and data that are classes-agnostic, use an interface. When you need a certain object type to share characteristics, use an abstract class.
- When you need to define an object type's characteristics, use an interface. When you need to define an object type's capabilities, use an abstract class.
C# linkedin learning
Which of the following is true of delegates?
- Only variables can be passed to delegates as parameters.
- They cannot be used as callbacks.
- Delegates are not supported in the current version of C#.
- They can be chained together.
C# linkedin test
Which of the following best defines C#'s asynchronous programming model?
- Inherited callback
- Reactive
- Task-based
- Callback-based
linkedin C# assessment answers
How would you determine if a class has a particular attribute?
Attribute.GetCustomAttribute(typeof(ExampleController), typeof(SubControllerActionToViewDataAttribute))
var type = typeof(SomeType);
var attribute = type.GetCustomAttribute
Attribute.GetCustomAttribute(typeof(ExampleController), typeof(SubControllerActionToViewDataAttribute))
typeof(MyPresentationModel).Should().BeDecoratedWith
linkedin C# test answers
What is the difference between the ref and out keywords?
- Variables passed to out specify that the parameter is an output parameter, white ref specifies that a variable may be passed to a function without being initialized.
- Variables passed to ref can be passed to a function without being initialized, while out specifies that the value is a reference value that can be changed inside the calling method.
- Variables passed to ref specify that the parameter is an output parameters, while out specifies that a variable may be passed to a function without being initialized.
- Variables passed to out can be passed to a function without being initialized, while ref specifies that the val