Can I determine the class name of an object instance at run-time?
instanceOf
verifies at runtime whether an object is actually an instance of a class...but you would have to write the conditions to check for them all. Also getSObjectType
will describe an sObject.
Voting for the idea Method to get the Type of an Object (also Primitive Type not only SObject) would be a good long term solution.