接下来,我将定义清单6所示的测试用例,它也包含一个参数,用于进行测试的应用程序的基url。
Next, I define the test case shown in Listing 6, which also takes a parameter for the base URL of the application under test.
然后您就可以在键入的以基类作为方法参数的方法中使用基类或任何一个子类。
You can then use the base class, or any of the subclasses, in methods that are typed to expect the base class as a method argument.
现在,如果在运行时作为基类型传递派生的子类,那么无法通过检查接口参数类型识别出子类。
When you now try to pass a derived subclass in terms of a base type at run time, the subclasses will not be recognized by simply introspecting the interface parameter types.
应用推荐