java - Get concrete Class realization from interface reference -


is possible in java obtain concreetclass.class interface reference isomeinterface. avoid 'instance of' keyword.
on other words, there:

isomeinterface intref = new concreetclass(); class realization = intref.getrealizationclass(); realization == concreetclass.class; // true  

if java doesn't support operation. recommend me way deal it?

getclass returns class of instance.

class<? extends isomeinterface> realization = intref.getclass(); system.out.println(concreetclass.class.equals(realization)); //true 

Comments

Popular posts from this blog

php - Invalid Cofiguration - yii\base\InvalidConfigException - Yii2 -

How to show in django cms breadcrumbs full path? -

ruby on rails - npm error: tunneling socket could not be established, cause=connect ETIMEDOUT -