Object variables are stored as 32-bit (4-byte) addresses that refer to objects. You can assign any reference type (string, array, class, or interface) to a variable declared as an Object.
An Object variable can also refer to data of any value type (numeric, Boolean, Char, Date, structure, or enumeration).
Note Although a variable declared with Object type is flexible enough to contain a reference to any object, the invocation of a method of an instance using an Object variable is always late (run-time) binding. To force early (compile-time) binding, assign the object reference to a variable declared with a specific class name or cast to the specific data type.
The equivalent .NET data type is System.Object.
Data Type Summary |