'sendPrListToScreen' is undefined for the type 'service class name'.
But as per my knowledge it is defined.
But when i use two different names of this method declared above then it works perfectly but iam not able to use the cream of Core Java.
name clash: sendPrListToScreen(List<PrDraftHeader> prDraftList) and sendPrListToScreen(List<PurchaseRequestHeader> prList) have the same erasure
Also, an administrative note. Please use real words. Because instead of b'coz. We have a lot of users who's first language isn't English. By using words like b'coz it just makes it more difficult to communicate.
The problem is your use of Generics. As far as the compiler is concerned during this sweep, the 2 methods are the same. You should be getting an error about duplicate method names.
i want to know that why the Generic lists cannot be used in Method Overloading in java ?
Is there an alternate solutions for it so that my purpose can resolved using method overloading ?
thank you once again
Vinod Vijay wrote:i want to know that why the Generic lists cannot be used in Method Overloading in java ?
That's because of the way generics are implemented in Java - with type erasure