Question About Abstract Classes?

Posted by IbrarMumtaz on Stack Overflow See other posts from Stack Overflow or by IbrarMumtaz
Published on 2010-05-15T17:04:37Z Indexed on 2010/05/15 17:14 UTC
Read the original article Hit count: 249

Filed under:
|
|
|

URL: Link (1)

According to this wesbite .. you cannot implement Abstract classes but derive from them. This makes sense and I have read this many times.

Like an interface, you cannot implement an instance of an abstract class, however you can implement methods, fields, and properties in the abstract class that can be used by the child class.

But on MSDN

URL: TextWriter CLass on MSDN

TextWriter is an abstract class but it has two constructors defined ... and according to the MS 70-536 book, the following statement is valid:

TextWriter tw = new File.CreateText("myFile.Txt")

The static file class and it's CreateText method is fine by me as I have studied it on MSDN but can somebody explain this little contradiction I have found? Surely I am not the first?

Why is instantaion of base abstract classes possible????

© Stack Overflow or respective owner

Related posts about 70-536

Related posts about .NET