📜  扑之间的区别?运算符和!运算符 - 任何代码示例

📅  最后修改于: 2022-03-11 15:00:55.400000             🧑  作者: Mango

代码示例1
# Differences between "!" and "?" operators 
students?.first >> the value of blocks can be null
students!.first >> you inform the compiler that you are certain that blocks are not null.

final student = students!.first; >> means you are completely assured that List? students is initialized before block assignment.
final student = students?.first; >> block will be nullable, but in final student = students!.first;, block is not nullable.