System.TObject.ClassName

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

class function ClassName: string;

C++

__classmethod UnicodeString __fastcall ClassName();

Properties

Type Visibility Source Unit Parent
function public
System.pas
systobj.h
System TObject

Description

Returns a string indicating the type of the object instance (as opposed to the type of the variable passed as an argument).

Use ClassName to obtain the class name from an object instance or class reference. This is useful for differentiating object instances that are assigned to a variable that has the type of an ancestor class.

Note: In C++ code, call ClassName as a method to obtain an object's class name. Use the global static function to obtain the class name from a metaclass object.

See Also

Code Examples