![](/img/trans.png)
[英]Dart: What is the difference when using this keyword and colon after the constructor?
[英]In Dart, what is the difference between using 'new' keyword and directly calling constructor?
我看到我被允許使用了
argument: MyClassName(a,b)
以及
argument: new MyClassName(a,b)
我想了解Dart中的new
選項? 或者這兩個回歸完全不同的東西?
在Dart 2.0強模式下, new和const是可選的,因此兩者都是相同的。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.