-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
Description
Like a regular type, but with a type parameter declaration attached.
A generic type is a reference type that has one or more type parameters. In the definition of the generic type, the type parameter section follows the type name. It is a comma separated list of identifiers and is delimited by angle brackets.
Example:
class Pair<X, Y> {
private X first;
private Y second;
public Pair(X x, Y y) {
this.first = x;
this.second = y;
}
public X getFirst() {
return first;
}
public Y getSecond() {
return second;
}
public void setFirst(X x) {
this.first = x;
}
public void setSecond(Y y) {
this.second = y;
}
}Reactions are currently unavailable