Friday 15 August 2014

java - Factory method to return an implementation of a given Interface -


itemprop = "text">

after

Cast is required because, there is no way in compiling time to tell that an example of a AddressBookFrame is T

To avoid warning, check the order in order:.

  returns uiClass.cast (new addressbookframe);   

To do this in this way, your map implementation will work and the type will be safe.

No comments:

Post a Comment