0

I went over the android api guide for openFileOutput and saw that it was used to "Open a private file associated with this Context's application package for writing. Creates the file if it doesn't already exist.

http://developer.android.com/reference/android/content/Context.html

My question is given there a need to handle the exception FileNotFoundException for his method. If the file is not found, wont this method just create a new one?(FileNotFoundException will never be thrown)

committedandroider
  • 8,711
  • 14
  • 71
  • 126

1 Answers1

2

There is one other exception, the name given could be associated with a directory. In that instance no file would be created and a FileAlreadyExistsException would be thrown.

laazer
  • 97
  • 9