Just interesting to know. Why the constructors are protected for those classes.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Because XmlReader/XmlWriter are abstract classes and it doesn’t make much sense to have a public constructor in an abstract class. This is a common factory pattern. You use the static
Createmethod which will return a proper implementation based on the argument types in a way that is completely transparent to the developer.