## Dart编程实例 - 泛型 Map```dartvoid main() { Map String,Stringm={name:Tom,Id:E1001}; print(Map :${m}); }```
## Dart编程实例 - 异常处理 使用 ON 块```dartmain() { int x = 12; int y = 0; int res; try { res = x ~/ y; } on IntegerDivisionByZeroException { print(
## Dart编程实例 - 异常处理 使用catch块```dartmain() { int x = 12; int y = 0; int res; try { res = x ~/ y; } catch(e) { print(e); }}``
## Dart编程实例 - on…catch```dartmain() { int x = 12; int y = 0; int res; try { res = x ~/ y; } on IntegerDivisionByZeroException catch(e) {
## Dart编程实例 - 异常处理Finally 块 ```dartmain() { int x = 12; int y = 0; int res; try { res = x ~/ y; } on IntegerDivisionByZeroException { prin
## Dart编程实例 - 抛出异常```dartmain() { try { test_age(-2); } catch(e) { print(Age cannot be negative); }} void test_age(int age) { if(ag
## Dart编程实例 - 自定义异常```dartclass AmtException implements Exception { String errMsg() = Amount should be greater than zero;} void main() { try { withdraw_amt(-1);
## Dart编程实例 - 添加断点```dartvoid main() { int a = 10, b = 20, c = 5; c = c * c * c; print($a + $b = ${a+b}); print($a%$b = ${a%b}); // Add a break point here prin
## Dart编程实例 - Typedef 类型定义```darttypedef ManyOperation(int firstNo , int secondNo); //function signature Add(int firstNo,int second){ print(Add result is ${firstNo+second});}
## Dart编程实例 - Typedefs 类型定义```darttypedef ManyOperation(int firstNo , int secondNo); //function signatureAdd(int firstNo,int second){ print(Add result is ${firstNo+second});}