This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Doubt regarding FileInputStream Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Doubt regarding FileInputStream " Watch "Doubt regarding FileInputStream " New topic

Doubt regarding FileInputStream

archu sweet
Ranch Hand

Joined: Mar 07, 2011
Posts: 66

when i ran this code i got No such file found, Doing finally, -1 as output...

All I need to know is FileInputStream creates a new file then how come no such file found is printed???
Rob Spoor

Joined: Oct 27, 2005
Posts: 19723

1) KeepItDown. No need for all uppercase sentences like that.
2) It's FileOutputStream that creates a new file if it doesn't exist yet. FileInputStream throws an exception.

How To Ask Questions How To Answer Questions
Don't get me started about those stupid light bulbs.
subject: Doubt regarding FileInputStream