• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Please hellllllp

 
Pratiti Naphade
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can u create an instance of filterinputstream...if yes how???
 
niraj singh
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
FilterInputStream cannot be instantiated as it is an abstract class. It can only be subclasses. The following are types of FilterInputStream's -
DataInputStream
BufferedInputStream
LineNumberInputStream
PushbackInputStream
 
Pratiti Naphade
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is not an abstract class...but yes its constructor is protected.
 
Paul Michael
Ranch Hand
Posts: 697
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i tried looking at the api and noticed that its methods are very similar if not exactly the same with InputStream's methods... does anyone here know why they had to subclass InputStream with FilterInputStream without providing any new functionalities? please correct me if im wrong... thanks!
 
Manfred Leonhardt
Ranch Hand
Posts: 1492
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI Paul,
FilterInputStream and InputStream have major functionality differences. They might have the same method signatures but the method guts are completely different for at least 80% of the code!
Regards,
Manfred.
 
Thomas Paul
mister krabs
Ranch Hand
Posts: 13974
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
InputStream is abstract so I would assume that there might be at least one difference between them.
------------------
Tom - SCJP --- Co-Moderator of the Programmer Certification Forums
 
Paul Michael
Ranch Hand
Posts: 697
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks Manfred and Thomas! i should have checked the source files! now why didn't i think of that?? *scratches head* hehe thanks again!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic