Multiple choice

__________ method creates only one preference file for the activity.

  1. getSharedPreferences()

  2. getPreferences()

  3. Both (1) and (2)

  4. None of these

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

The getPreferences() method (called without a name parameter) creates a single preferences file specific to that activity. In contrast, getSharedPreferences() requires a name parameter and can be shared across different activities or components.