I started working on Android applications and I find little difficult to understand this piece of code:
LineNumberReader(new FileReader("/proc/tty/drivers"));
How can I know that the LineNumberReader function accepts FileReader as a new instance of the class? I went through the Java documentation for the LineNumberReader API, it doesn’t mention anything regarding FileReader class. There is problem in Java API interpretation which I have to consider, Can any one of you please help me in understanding how an API should be used in Java?
I suspect you actually saw:
The
LineNumberReaderdocumentation shows a constructor taking aReaderparameter, andFileReaderextendsReader. So think of it like this:Is that clearer for you?