In scala, is there any way to check if an instance is a singleton object or not?

Viewed 1045

If I have an instance of an object, is there a way to check if I have a singleton object rather than an instance of a class? Is there any method can do this? May be some reflection API? I know that one difference is that the class name of a singleton object ends with a $, but this is not a strict way.

2 Answers
Related