0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

初級Dart (var)

Posted at

var

Javaユーザを想定したDART言語の特徴として、型指定にvarを使うことができ、変数の型宣言を簡略化できる。


void main() {
// 整数の型宣言
  int aa = 100;
  
// varによる型推論の記述
  var bb = 123;
}

変数の型が決まった後は、別の型へ変更することはできない
たとえば、int型と推論された変数に、double型やString型を入力することはできない
image.png

参照

  1. javaのvarについて
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?