13-06-2012, 11:10 AM
Seminar on Data Types
Data Types.ppt (Size: 108.5 KB / Downloads: 39)
Data Objects
A run-time grouping of one or more pieces of data in a virtual machine
a container for data
it can be
system defined
programmer defined
A data type is a class of data objects together with a set of operations for creating and manipulating them.
Specification of a data type:
attributes
valid values
valid operations
example: specification of an array
Elementary Data Types
Elementary data object contains a single data value.
A class of such data objects and the valid operations: elementary data type.
Type Checking
Checking that each operation executed by a program receives the proper number of arguments of the proper data type.
Dynamic type checking: run-time (type tags for data objects)
Static type checking: compile-time
Dynamic Type Checking
Advantage: Flexibility
Disadvantages:
difficult debugging, some paths never checked.
Extra storage for type information during program execution.
Software simulated type checking, reducing speed.