Is String a primitive or an Object in Android or Java?

后端 未结 6 1369
無奈伤痛
無奈伤痛 2020-12-14 18:12

In the Android API http://developer.android.com/guide/topics/data/data-storage.html#pref

It says:

Shared Preference allows you to save and re

6条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-14 18:41

    When using Android SharedPreferences you will use getString and putString (with SharedPreferences.Editor) in which case both are Java String Objects. The Java documentation explains that a String isn't technically a primitive, but because it is often treated as one syntactically and it's prevalence it may sometimes be called a primitive. Android probably uses this definition (see http://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html)

提交回复
热议问题