File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 6969 - [x] Need to be inside an `abstract` class
7070 - [x] Not be overriden
7171
72+ #. A method …
73+
74+ - [ ] … can be accessed from any class if it is marked `protected`.
75+ - [ ] … can be accessed from its derived classes if it is marked `private`.
76+ - [ ] … is recursive if it terminates.
77+ - [x] … is recursive if it calls itself.
78+ - [x] … must be overridden if it is marked `abstract`.
79+ - [ ] … cannot be overriden if it is marked `sealed`.
80+
7281#. Give at least two differences between an abstract class and an interface.
7382
7483 <details><summary>Solution</summary>
Original file line number Diff line number Diff line change 5353 - [ ] The keyword `out` cannot be used in the header of a method.
5454 - [ ] An `out` parameter cannot be assigned a value.
5555
56+ #. A method is forced to set the value of an ` int ` argument ` c ` passed as a reference, if it has…
57+
58+ - [x] … `out int c` in its header
59+ - [ ] … `int out c` in its header
60+ - [ ] … `ref int c` in its header
61+ - [ ] … `int ref c` in its header
62+
63+ #. A method with header ` public virtual void Test(int a, ref int b) ` will…
64+
65+ - [ ] Return a value
66+ - [ ] Set the value of `a`
67+ - [ ] Set the value of `b`
68+ - [x] Assume that `a` has a value
69+ - [x] Assume that `b` has a value
70+ - [ ] Be impossible to override
71+
5672## Warm-up Exercises
5773
5874#. Consider the following code:
You can’t perform that action at this time.
0 commit comments