Processing math: 60%

Previous Up Next

Object

The Object class is the root of the inheritance graph. Even the other basic classes (e.g., IO and Int) inherit from Object (and thus inherit the three methods listed below). It is an error to redefine Object. Methods with the following declarations are defined:

abort() : Object
type_name() : String
copy() : SELF_TYPE

The method abort flushes all output and then halts program execution with the error message \rm \LQT abort \backslash n \RQT.

The method \rm type\_name returns a string with the name of the (run-time, dynamic) class of the object.

The method \rm copy produces a \it shallow copy of the object.(4)

Previous Up Next