Generic type parameters can't be instantiated with primitive types.
不能用基本类型实例化泛型类型参数。
This method receives several parameters, including a SQL statement and a result handler, and returns an object of generic type t.
这个方法接收多个参数,包括一条sql语句和一个结果处理程序,并返回一个泛型t的对象。
The signature format extends the idea of field and method descriptors to include generic type information.
签名格式扩展了字段和方法描述符的概念,将泛型类型信息包含于其中。
For example, you might want to use another generic type system such as Service Data Object (SDO) (see Resources).
例如,你可能希望使用另外一种通用类型系统如服务数据对象(SDO)(参见参考资料)。
DOUBLE is the generic type used in various models.
DOUBLE是在各种模型中使用的通用类型。
Because I want to demonstrate decoding generic types for this column, the type information needs to include the specific parameter types used with a generic type reference.
因为我想在这一期中演示泛型的解码,所以类型信息需要包含泛型引用所使用的具体的参数类型。
Likewise with the generics changes — the generic type information is used by the compiler to enforce compile-time safe usage, but the generated bytecode still USES casts everywhere.
比如泛型更改——泛型类型信息——由编译器用于实施编译时安全,但是生成的字节码仍然到处使用强制转换。
A signature defines the actual parameter types used with a generic type, so it provides the information I'll need to process type substitutions.
签名定义了泛型实际使用的参数类型,所以它提供了处理类型替换时需要的信息。
Just as the type parameters of a generic class are wrapped in Angle brackets, the arguments of a generic type application are wrapped in Angle brackets as well.
就像泛型类的类型参数用尖括号括起来那样,泛型类型应用程序的参数也是用尖括号括起来的。
But it's not always convenient to load classes into the JVM to access generic type information.
但是在JVM中装载类以访问泛型类型信息并不总是方便的。
To increase the usefulness of our generic code, instead of specifying the exact type of a generic type parameter, we can specify an upper (or lower) bound instead.
要提高泛型代码的有效性,可以指定一个上限(或下限),而不是指定某个泛型类型参数的精确类型。 这可以使用有界通配符来实现,它的形式为 “?
The angle brackets assign a specific type (that is, the parameterized type) to the generic type represented by the "T" argument types.
尖括号为由 “T”参数类型表示的泛型指定具体类型。
Generic type parameters and primitive types.
泛型类型参数和基本类型。
Another example: Generic type inference.
另一个示例:通用类型推断。
The Infer Generic Type Arguments refactoring automatically tries to guess the appropriate generic types for classes used in their raw form.
InferGeneric TypeArguments重构会自动地为原始形式的那些类推测恰当的泛型类型(generic type)。
As a concrete example, consider Listing 3, which declares a generic type Box and invokes the Box constructor.
作为具体示例,请考虑清单3,声明了通用类型Box并调用了Box结构函数。
Once this setup code is ready, we retrieve the field representing the talks, and we check that the generic type information is correct: yes, talks is a List, but a List of talks.
当初始化代码就绪后,我们取得代表talks的成员变量,然后检查泛型信息是否正确:正确! talks是一个List,但是它是一个talk的List。
As an example application, I'm planning to use generic type information to improve the default binding generator provided with my JiBX XML data binding framework.
作为一个示例应用程序,我准备使用泛型类型信息改进我的JiBXXML数据绑定框架中提供的默认绑定生成器。
The generic type of the Future object is the result of the actual operation.
Future对象的通用类型是实际操作的结果。
To support mixins through generic types, we need to have run-time representations of the generic type instantiations available.
为了通过泛型类型支持mixin,我们需要获得泛型类型实例化的运行时表示。
Because the runtime cannot tell a List from a List (at runtime, they're both just Lists), constructing variables whose type is identified by a generic type parameter is problematic.
因为运行时不能区分List和List(运行时都是List),用泛型类型参数标识类型的变量的构造就成了问题。
Another consequence of erasure is that using casts or instanceof with generic type parameters doesn't make any sense. The following code will not improve the type safety of your code at all.
擦除的另一个后果是,对泛型类型参数是用强制类型转换或者instance of毫无意义。
The type parameters of the generic type Map were inferred as [Nothing,Nothing] when the map was created.
范型类型Map的类型参数在map被创建时被推断为[Nothing, Nothing]。
That contract does not allow this method to throw a run-time exception (barring violations of generic type safety that qualify as bugs in the calling code).
这个合约不允许该方法抛出运行时异常(防止因违反泛型类型安全而成为调用代码中的bug)。
Unchecked generic type operation The compiler will issue an error or warning whenever it encounters an unchecked generic type operation.
Uncheckedgeneric typeoperation编译器每当遇到未经检查的泛型类型操作,就将发出一个错误或者警告。
After I use the Infer Generic type Arguments refactoring, Eclipse automatically determines the correct type parameters and produces the code shown in Listing 8.
在使用了InferGeneric TypeArguments重构后,Eclipse会自动地确定正确的类型参数并生成清单8中的代码。
If you define your own generic type of method the resulting assembly currently would not work.
如果您定义了自己的范型类型,则程序集可能无法运行。
The IL we’ve generated for the generic type already has the method its going to call picked out.
我们为泛型生成的IL代码已经定好了将要去选出调用的方法。
Recall from Chapter 1 that Scala USES square brackets ([...]) for generic type parameters.
回忆在第1章中Scala使用方括号来指明范型类型参数。
The key to the dependency-injection approach is that you query data by injecting the Class of the entity that the DAO will be querying, along with defining the generic type.
依赖项注入方式的关键是,在查询数据时,要注入DAO将查询的实体的Class并定义泛型类型。
应用推荐