string - 为什么在 Dart 中声明字符串要大写?

标签 string flutter dart

这个问题在这里已经有了答案:





Dart datatype naming convention.. Why String instead of string

(2 个回答)


上个月关闭。




在 Dart int 中,double 和 bool 用小写字母声明,为什么字符串声明为 String?

是否有一个原因?

最佳答案

Not exactly, in Java it makes sense because String is not a primitive type like int, String inherit from Object. But in Dart why is String not declared "string" like int, when both inherit from Object class?



大写 Dart 中的每种类型可能更有意义,包括 Int、Double 和 Bool,因为它们都是 Object 的后代,而所有其他类型都大写。所以问题不是为什么 String 大写,而是为什么 int、double 和 bool 没有大写。我假设他们只是选择了一种让 Java 程序员对 Dart 感到熟悉的命名方案,但我真的不知道。

关于string - 为什么在 Dart 中声明字符串要大写?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60493086/

相关文章:

c# - 获取 C# 字符串中字符的 ASCII 值

android-studio - 更新后 Android Studio Flutter 错误

dart - Flutter http 错误类型 '_InternalLinkedHashMap<dynamic, dynamic>' 不是类型 'Map<String, String>' 的子类型

android - 在 package :html, dart :html, dart:io (class HttpClient) 和 package:http APIs 之间选择获取 HTTP 资源

dart - 如何从树中删除小部件

php - 用数组中的值替换所有出现的字符串

JavaScript split() join() 仅适用于精确短语

python - Numpy 字符串分区 : Perform Multiple Splits

Flutter:删除按钮中的填充 - FlatButton、ElevatedButton、OutlinedButton

firebase - Firebase实现中的抖动问题