Android Application Development (AND-401) — Question 47
Which of the following is NOT true about the SharedPreferences interface?
Answer options
- A. The data it saves is persistent even if application is killed.
- B. It only saves primitive data in key-value pairs.
- C. Modifications to preferences saved should go through class SharedPreferences.Editor
- D. It can save any data type in key-value pairs.
Correct answer: D
Explanation
The correct answer is D because SharedPreferences can only store primitive data types, such as strings, integers, and booleans, not complex data types. Options A, B, and C are accurate statements about the functionality and limitations of the SharedPreferences interface.