posted 14 years ago
Greetings!, I've read the Generics stuff many times, and I also have searched the forum, but my question keep unanswered :-(:
Let's say you have declared these classes:
so, why the following lines are INCORRECT?:
They all fail in compilation time, so, (again), what is the purpose of being able to declare a generic class with the metacharacter '?' if then you cannot use methods with arguments of the generic Type??? (because you CAN use otroMetodo without any problem). It could be to prevent modification of the Generic object received as argument? (It seems a too strong limitation to me!!). Anyway, IMHO, if you cannot USE these kind oh methods, the compiler should alert you in their DECLARATION (because they are useless!), not when you try to use them. Or am i missing something?. Any help/explanation would be very appreciated, thanks!