Most cases, we use class name to define type of a variable and one of its constructor with new keyword while instantiation of an object. A class can have many constructors....you can pick any based on your need. I have edited the question also as you wrote "constructor1" at left hand side of first code line. It should be class name. I understand the reason of confusion: "The constructor is a method in a class with same name". And in C#...."If you do not provide a constructor for your object, C# will create one by default that instantiates the object".
For more, please have a look on:
http://msdn.microsoft.com/en-us/library/ms173115.aspx[
^]
and
An Intro to Constructors in C#[
^]
And as already other fellows confirmed...you are right...that StreamReader is getting instantiated...in your case it is using a particular constructor which takes file name. And on RHS, you have
TextReader because TextReader is a parent class of StreamReader so you are creating the instance of SreamReader and putting it into a variable which is a type of "TextReader".
public class StreamReader : TextReader
Your code "TextReader reader = new StreamReader(filename);"..... is equivalent to below code:
TextReader reader;
StreamReader s1;
s1 = new StreamReader(filename);
reader = s1;
As given at
http://msdn.microsoft.com/en-us/library/system.io.streamreader(v=vs.110).aspx[
^], StremReader class is having many constructors and inherited from "TextReader".
Feel free to discuss more. Thanks.