Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

InputStream,how to use

 
linus dale
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


why is this line correct
i is of class InputStream,how can it become object of FileInputStream

generally we write

or



Also is there a class like FileInputStreamReader
or FileInputStreamWriter
or FileOutputStreamReader
or FileOutputStreamWriter






 
Ulises Pulido
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is correct because InputStream is a superclass of FileInputStream.

You can assign directly a reference of a child class to a parent class.


As far as I know there are not such classes you are asking for

But there are FileReader and FileWriter.

 
linus dale
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ulises Pulido wrote:Is correct because InputStream is a superclass of FileInputStream.

You can assign directly a reference of a child class to a parent class.


As far as I know there are not such classes you are asking for

But there are FileReader and FileWriter.



thanks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic