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

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -