Question on generic method
posted 6 years ago
You know that the list is of type A, but the go method can be called with any type of object. Suppose if you call go method with an instance of class C or if I call the go method with an instance of Integer class, then what?? Your call to go method will work at runtime, you know that, but the compiler has to make sure that there is no way the go method can be called in such a way that it breaks type safety...