您是正确的,在Java中字符串为not a primitive data type:
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.
Enclosing your character string within double quotes will automatically create a new String object; for example, String s = "this is a string";.
The String class is not technically a primitive data type, but considering the special support given to it by the language, you’ll probably tend to think of it as such.
但是,在这种情况下,“原始”可能不是指Java基本类型,而是指从简单到复杂的范围.
您引用的页面在“存储快速视图”中具有以下几点:
>对原始数据使用共享首选项
>将内部设备存储用于私有数据
>将外部存储用于非私有的大型数据集
>使用SQLite数据库进行结构化存储
这似乎使规模从简单到复杂(原始,大型和结构化).
也许Android只是遵循Java教程中提到的文本(见上文),并且将字符串视为原始类型,尽管从技术上讲并非如此.
您知道,尽管Python / Ruby / Smalltalk爱好者会争辩说,原始类型的存在使该声明为假,但直到您为了保护您的头脑而掉下来之前,我们也以Java声明为面向对象的相同方式:-)
无论如何,我不确定这是否重要. Android主要是由Android文档指定的,而Java文档是后备的(正如您通过不同的国际化方法所看到的).它旨在利用Java技能,而不是提供完全相同的环境.
如果Android文档将字符串视为原始字符串,则至少在可用于共享首选项方面将其视为原始字符串.