Practice mode C#

Which C# access modifier limits a member to derived classes that are in the same assembly?

Correct answer C. private protected

Explanation

private protected, added in C# 7.2, allows access from the containing class and from derived classes declared in the same assembly only. protected alone allows derived classes in any assembly, internal allows any code in the same assembly, and protected internal allows either. Remember that private protected is the narrowest of the combinations.

Report a problem

Answer checked How we write and check questions

Tip: press A, B, C or D to answer, and N for the next question.

Advertisement

Have a question about this answer?

Your email address will not be published. Required fields are marked *

Links and website addresses are not allowed in comments.