如何在 Dart 中的一条语句中打印多种数据类型?

问题描述 投票:0回答:1

I want to print multiple Data type in one statement but come an error showed in picture. please help to fixed this problem.

void main(){
int age=21;
String name= "Rubel";
print($name, $age);
//i want to print name and age at a time. can i do this?
dart dart-pub
1个回答
0
投票
void main(){
  int age=21;
  String name= "Rubel";
  print("$name, $age");
}
© www.soinside.com 2019 - 2024. All rights reserved.