I study and experiment with Java generics and come up with the following piece of code that does not compile as expected. Result cannot be resolved . I means input, O for output.
public interface Stats<I, O> { O addItem (int index, I item); } public class AStats implements Stats<Item, Result> { public static enum Result { SUCCESS1, SUCCESS2, ERROR; } @Override public Result addItem (int index, Item item) {
source share