T
- primitive typepublic class Pointer<T>
extends java.lang.Object
// The class must be initialized before the function is called.
Pointer<Integer> number = new Pointer<>(0);
setNumber(number);
public void setNumber(Pointer<Integer> value)
{
// You can not initialize a class inside a function
// because it creates a new class reference and value != number.
//value = new Pointer<>(11);
value.setValue(100);
}
Modifier and Type | Method and Description |
---|---|
T |
getValue() |
void |
setValue(T value) |