Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

FileReader querry

 
Sadaqatullah Noonari
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using FileReader class in my code. It say an error when it does not find the file. I want to handle this error such that if file is not found, it makes and then moves on. need help in this problem.
 
Hebert Coelho
Ranch Hand
Posts: 754
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Put a try/catch when this exception happens, and return/continue(inside a loop).
 
Randall Twede
Ranch Hand
Posts: 4385
3
Java
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yeah that is easily done. i have an old example i remember...hold on
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic