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

html - Difficulties with background-image property -

visual studio code - What does the isShellCommand property actually do and how should you use it? -

ios - Segue not passing data between ViewControllers -