I’m writing a piece of code in which I have to cast an Object if it is an instance of a certain class.
As usual I’m using instanceof for checking the compatibility.
The problem is that the check is never satisfied because the objects belong to “strange” classes.
For example; when I call the method getClass().getSimpleName() on this object it return me the name of the class + $* (e.g. ViewPart$1 instead of ViewPart).
What does this $* means?
Is there a solution or a workaround?
That shows an inner class (either anonymous (if it has a number) or named). For example:
The name of class
Foo.BarisFoo$Bar. Now if we had:That will print
Foo$1.You can see the same effect in the naming of the class files created by javac.