Dart语言简介
  1. 变量与类型系统
变量与类型系统

Last updated by Yarco on Wed, 18 Sep 2019 04:29:01 +0000

本系列: A tour of the Dart language

示例

var name = 'Voyager I';
var year = 1977;
var antennaDiameter = 3.7;
var flybyObjects = ['Jupiter', 'Saturn', 'Uranus', 'Neptune'];
var image = {
  'tags': ['saturn'],
  'url': '//path/to/saturn.jpg'
};

基本类型

  • null
  • bool
  • num: int, double
  • String: single quote, double quote, triple quote, string template

通用容器

  • Set: {‘’}
  • List: []
  • Map: {‘’:’’}

存储类型(变量修饰符)

  • const
  • final
comments powered by Disqus