crayy
❔ Some theory questions I'm unsure about :)
I just have a few questions that I'm unsure about when I was revising for an exam. Sorry if some are a bit stupid but I just want to make sure. Could anyone answer some of these if you're sure about the answer?
(on this one I am confused because I believe that both 2 and 3 could be right in a way, but only one can be)
1) A C# Interface is basically (1 correct):
1. A specification of how an object can be used -
2. A specification of how a class will publicly implement something -
3. Essentially an abstract class -
4. None of the above is correct -
2) In c#, which among the listed options is has greatest advantage over the others (inheritance, encapsulation, polymorphism)? __ (if i'm not mistaken that's such a weird question because a lot of different things can depend on that)?
3) 7) 33. Which of the listed principles are used in this C# code?
----------------------------
int p = 3;
Func<int, int> q = x=>x * p;
p = 5;
int answer = q(2);
---------------------------
1. deferred execution -
2. polymorphism -
3. variable hoisting -
4. multitype -
5. generic types -
6. interfaces -
4) C# extension methods are useful in __ classes (1 correct):
1. generic -
2. .NET -
3. user -
4. a+b+c -
5) What can we create with generic types? (1 correct):
1. object -
2. sequence -
3. encapsulation -
4. none of the above -
59 replies