I'm learning for the Microsoft Exam 70-483. In this exercise the correct answers are A and F. In my opinion E is correct too. I think E is fully equivalent to A + F. Is it true?
Question:
You are creating a class named Employee
. The class exposes a string property named EmployeeType
. The following code segment defines the Employee
class. (Line numbers are included for reference only.)
01 public class Employee
02 {
03 internal string EmployeeType
04 {
05 get;
06 set;
07 }
08 }
The EmployeeType
property value must be accessed and modified only by code within the Employee
class or within a class derived from the Employee
class.You need to ensure that the implementation of the EmployeeType
property meets the requirements. Which two actions should you perform? (Each correct answer represents part of the complete solution. Choose two.)
A. Replace line 05 with the following code segment: protected get;
B. Replace line 06 with the following code segment: private set;
C. Replace line 03 with the following code segment: public string EmployeeType
D. Replace line 05 with the following code segment: private get;
E. Replace line 03 with the following code segment: protected string EmployeeType
F. Replace line 06 with the following code segment: protected set;
There must be an error in your question. You can't choose 2 responses and answer the question. The only correct answer is E
protected
is not more restrictive than internal
.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With