main() {
try {
test_age(-2);
}
catch(e) {
print('Age cannot be negative');
}
}
void test_age(int age) {
if(age<0) {
throw new FormatException();
}
}
原创文章,作者:ItWorker,如若转载,请注明出处:https://blog.ytso.com/266229.html