typeof

In languages that support polymorphism and type casting, the typeof operator may have one of two distinct meanings when applied to an object.

In some languages, such as Visual Basic,[1] the typeof operator returns the dynamic type of the object.

In other languages, such as C#[2] or D[3] and, to some degree, in C (as part of nonstandard extensions and proposed standard revisions),[4][5] the typeof operator returns the static type of the operand.

That is, it evaluates to the declared type at that instant in the program, irrespective of its original form.

In a non-standard (GNU) extension of the C programming language, typeof may be used to define a general macro for determining the maximum value of two parameters: In Java the keyword is instanceof.