通常,您将实现
Runnable或
Callable作为支持通用输入参数的类;例如
public class MyRunnable<T> implements Runnable { private final T t; public MyRunnable(T t) { this.t = t; } public void run() { // Reference t. }}
通常,您将实现
Runnable或
Callable作为支持通用输入参数的类;例如
public class MyRunnable<T> implements Runnable { private final T t; public MyRunnable(T t) { this.t = t; } public void run() { // Reference t. }}