Data Type
The data type of a value or variable in some contexts is an attribute that tells what kind of data that value can have. In another words its a classification which specifies what type of value a particular variable have and also specifies that what type of operation we can apply on it. these operations can be mathematical, relational and logical operations also.
For example an int or integer is data type which used to classify the whole numbers. likewise a string is a data type used to classify a text.
Basically data type defines which operations we can perform without causing errors. also, which operations should be perform safely to create, transform and use the variable in another computation.
Data types define particular characteristics of data used in software programs and inform the compilers about predefined attributes required by specific variables or associated data objects
Two most important things to know about data types
- They defines certain domain of values
- they defines operations allowed on values
User defined data type
The operation and values of user defined data types are not specified in the language itself. It is specified by user.
Examples,
Abstract data type
The abstract data types are also known as ADT. ADT's are like user defined data types which defines operations on values using functions without specifying what is there inside the function and how the operations are performed.
The main important fact about ADT is they provide abstraction.
0 Comments