android - Java wildcard is interface -


i have following method:

protected <t> t casttointerface(class<t> tclass, context parent) {     try { return tclass.cast(parent); }     catch (classcastexception e) {         throw new classcastexception(string.valueof(parent)                 + " must implement " + tclass.getsimplename());     } } 

wile method it's job, curious, possible equivalent of

protected <t extends interface> t casttointerface(... 

so method accepts classes interfaces?


Comments

Popular posts from this blog

php - trouble displaying mysqli database results in correct order -

depending on nth recurrence of job in control M -

sql server - Cannot query correctly (MSSQL - PHP - JSON) -