I want to write a universal type observer in Java. In C ++, I can easily do this using the Variadic template from C ++ 11, for example:
class Observer<typename... T> { void update(T... args); };
Now, in java, the best I can do is:
class Observer<T> { void update(T args); };
Now an update cannot accept several arguments of different types, for example, in C ++. Can anyone suggest a solution to this problem?
Thanks in advance.
source share