是字符串原始或Android或Java中的对象? [英] Is String a primitive or an Object in Android or Java?
问题描述
在Android的API 的http://开发商.android.com /引导/主题/数据/数据storage.html#preF
In the Android API http://developer.android.com/guide/topics/data/data-storage.html#pref
它说:
共享preference可以让您保存和检索持久键值 对基本数据类型。您可以使用共享preferences保存 任何原始数据:布尔值,花车,整数,多头和字符串
Shared Preference allows you to save and retrieve persistent key-value pairs of primitive data types. You can use SharedPreferences to save any primitive data: booleans, floats, ints, longs, and strings.
是字符串原始数据类型或对象?
Is String a primitive data type or an Object?
推荐答案
据的Java
编程语言被认为是,
一个基本类型为predefined的语言,被命名为保留关键字。
A primitive type is predefined by the language and is named by a reserved keyword.
除了上面列出的八种原始数据类型,Java编程语言还提供了通过 java.lang.String中
类字符串的特殊支持。
In addition to the eight primitive data types listed above, the Java programming language also provides special support for character strings via the java.lang.String
class.
所以,象这样在的Java
的书,它不是一个关键字,而不是原始的两种。 共享preferences
仍然可以把它叫做原语之一,但这不是从的Java的书
这样,可能是因为它是一组基本类型,如整数,浮点,字符等,我们遇到的一个。
So, as such in Java
books, it's not a keyword and not a primitive either. SharedPreferences
may still call it one of the primitives, but that's not from the book of Java
as such, it could be because it's one of the set of basic types like int, float, char etc we come across.
这篇关于是字符串原始或Android或Java中的对象?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!