I’m trying to create a function that uses the value of ? for the type of a variable’s type. How would I write this?
interface MyInterface<TYPE extends Collection> {
TYPE getResult();
void useResult( TYPE inResult );
}
class SomeOtherClass {
static void moveObject( MyInterface<?> inObj ) {
//I'm using the wrong syntax on the next line, but I'm not sure
// what I should use here.
<?> result = inObj.getResult();
inObj.useResult(result);
}
}
Add a
<T>betweenstaticandvoid: