Which method opens a private file for writing in internal storage?

  1. getExternalStorageDirectory()
  2. File("sdcard/notes.txt")
  3. openRawResource()
  4. openFileOutput("notes.txt", MODEPRIVATE)
Answer

D) openFileOutput("notes.txt", MODEPRIVATE)

openFileOutput writes to the app's private filesDir.

Computer Science MCQ · More UI Events, Views, Preferences and Data Storage MCQs · Practise