In short, the moral to this story is to always convince yourself that the invariants inside a code block ensure that any casts in the block will always succeed.
简言之,这些方法的本质总是使您确信代码块内部的不变量会确保代码块中的任何类型强制转换都将成功。
The short code block in Listing 22 demonstrates how you can display a message to the console upon any adding, deleting, or changing a record in the RMS.
清单22中的一小段代码展示了如何在RMS的记录发生添加、删除或更改的时候把消息显示在控制台上。
应用推荐