Ankur kothari wrote:hey there are no compile errors in any one of them,warning in the second but none in the first....
Who said there are compilation errors, there will be a runtime exception in both of them. I'm getting a warning in the first program
Are you compiling the program from command line??
and what about that K&B says that generics on both sides should be same
Where exactly is this stated in the book?? Can you quote the exact statement...