domingo, 28 de septiembre de 2014
DATA TYPES
In a broad sense, a data type defines a set of values and operations on those values. Almost all programming languages explicitly include notation of the data type, though different languages may use different terminology. Most programming languages allow the programmer to define additional data types, usually combining multiple elements of other operations and defining new data type.
Data types allow us to represent the different data that are needed when implementing a program.
The data types are:
WHOLE DATA TYPES
1) The byte data type can represent integers byte data are in the range of -128 to +127. The size of a data type byte is 8 bits.
2) The short data type short integers can represent data that are in the range of -32768 to +32767. The size of a short data type is 16 bits.
3) int int data type can represent integers data are in the range -2147483648 to +2147483647. The size of an int data type is 32 bits.
4) long int data type can represent integers data are in the range -9223372036854775808 and +9223372036854775807. The size of an int data type is 64 bits. To indicate explicitly that the data is a long, add an L at the end ol the value of the variable.
FLOATING DATA TYPES
1) float The float data type can represent floating-point data that are in the range of 1.40239846e-45f and 38f 3.40282347E +. The size of a short data type is 32 bits. To indicate explicitly that the data is a float, add an F at the end of the variable value.
2) double data type double can represent floating-point data that are in the range of
4.94065645841246544e-324d and 308d 1.7976931348623157E +. The size of a short data type is 64 bits. To indicate explicitly that the data is a double, it adds a D od end of the value of the variable.
BOOLEAN DATA TYPE
The boolean data type can represent two logical values: true (true) or false (false).
DATA TYPE CHAR
The char data type is used to represent characters (Unicode code). A character is represented internally by an integer.
Suscribirse a:
Enviar comentarios (Atom)
No hay comentarios:
Publicar un comentario