Instead of having the constructor argument, Listing 5 shows how to do the same thing with a constant-specific body.
但没有构造函数参数,清单5展示了如何利用特定于常量的主体来做同样的事。
In the contrived example shown in Listing 5, I validate the passed argument, and if it is invalid, I raise an exception.
在清单5所示设计示例中,我验证所传递的参数,如果它是无效的,我就提出异常。
The code at the top of Listing 8 is the same code discussed in Listing 5 and provides the functionality for the a "l argument."
清单8顶部的代码与清单5中所讨论的代码类似,提供了—l参数对应的功能。
应用推荐