Android Application Development (AND-401) — Question 58

When creating a file using android.content.Context.openFileOutput("test.txt", 0), where is the file created?

Answer options

Correct answer: B

Explanation

The file is created in the directory /data/data/<package name>/files, which is the standard location for application-specific files. Options A, C, and D point to incorrect directories that do not apply to where an app's private files are stored.