Before moving on to initializer list examples and typical usage, let's look at what is meant by type narrowing.
在研究初始化器列表示例和典型用法之前,先讨论一下什么是类型窄化。
When you select an environment profile, you can optionally filter the list of available profiles by providing an environment type other than all.
在选择环境概要文件时,通过提供All之外的其他环境类型,可以筛选可用概要文件列表。
The instanceof function provides a good way of checking type, but you can also roll object type checking into the method signature itself by using type hints in the argument list.
虽然 instanceof 功能提供了一种检查类型的好方法,但您还可以通过在参数列表中使用类型提示,来将对象类型检查滚动到方法签名自身中。
应用推荐