February 2014
Beginner
1248 pages
62h 25m
English
Line 22 begins method printArray’s declaration. All generic method declarations have a type-parameter section (<T> in this example) delimited by angle brackets that precedes the method’s return type. Each type-parameter section contains one or more type parameters, separated by commas. A type parameter, also known as a type variable, is an identifier that specifies a generic type name. The type parameters can be used to declare the return type, parameter types and local variable types in a generic method declaration, and they act as placeholders for the types of the arguments passed to the generic method, which are known as actual type arguments. A generic method’s body is declared like that of any ...
Read now
Unlock full access