If you change your code as above you wont find any problem. Because Reader class is abstract, you cannot instantiate it.
Joined: Apr 07, 2007
Hmm.. I'm having a compilation error as follow.Thanks for the quick reply.
Joined: Oct 29, 2006
Well Dolly we aren't instantiating Reader Interface here..we are just assiging the reference of the BufferedReader object to Reader refernce varialble and since BufferedReader implements Reader hence BufferedReader "IS A" Reader..
the code is absolutely fine..sheena I hope you are using javac 1.5 compiler..because that is the only reason I can think of for not compliling the code !!!