How to Document Generic Type Parameter (#15108)
* How to Documeny Generic Type Parameters * How to Documeny Generic Type Parameters
This commit is contained in:
parent
57840bb083
commit
4c06d8e9f9
@ -0,0 +1,23 @@
|
|||||||
|
package com.baeldung.generictype;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param <T> The type of the first value in the {@code Pair<T,S>}.
|
||||||
|
* @param <S> The type of the second value in the {@code Pair<T,S>}.
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class Pair<T, S> {
|
||||||
|
public T first;
|
||||||
|
public S second;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructs a new Pair object with the specified values.
|
||||||
|
*
|
||||||
|
* @param a The first value.
|
||||||
|
* @param b The second value.
|
||||||
|
*/
|
||||||
|
|
||||||
|
public Pair(T a, S b) {
|
||||||
|
first = a;
|
||||||
|
second = b;
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user