In Qore (according to the tag for the question) you need to use the <object> :: className () pseudo method on your object.
Example:
prompt% qore -nX '(new Mutex()).className()'
"Mutex"
If you are in a class, use this pseudo-method for an automatic variable self:
prompt% qore -ne '
class T {
string getClassName() {
return self.className();
}
}
class U inherits T {}
printf("%s\n", (new U()).getClassName());
'
U
Alternatively, you can also use the get_class_name () function , as shown in the following example:
prompt% qore -nX 'get_class_name(new Mutex())'
"Mutex"
: , -, , - , .