Originally posted by Serge Petunin:
All the information about generics is for compile time only, it's erased for the runtime. The method signature that's left is called erasure.
For example, for the method set(E e) in the Parent class, the erasure's going to be set(Object e).
So during runtime you're gonna have two identical methods, which were not explicitly overriden: public void set(Object e) in the Parent class and public void set(Object arg) in the Child class. This causes the name clash.
[ December 21, 2007: Message edited by: Serge Petunin ]
Above i got it from mock exam
www.javabeat.com site.
But i am still not satisfied ...see here their is a statement
"class child extends Parent<Number> so parent class set(E e) should be (Number e)
and in child class if we have option c, which is set(Object e), then what is wrong in it?Wont it be a vaild overloading example.
Iam bit confusede here.....
[ December 22, 2007: Message edited by: Maan Shenoy ]
[ December 23, 2007: Message edited by: Maan Shenoy ]