Simple Data Types
Data are simply pieces of information, and an individual piece of information is a datum. Common usage, however, allows "data" as both the singular and plural form of the word. In the hardware of computers, data exists as bits and bytes stored as electronic memory. The function of a program or application (software) is to manipulate data. Each program formats data in a specific way that classifies a particular type of information. Humans learn to do this automatically and can easily distinguish between a number or a letter or what a percentage (%) character means. Computers, however, must be told what these data types mean within each programming language; therefore, the programmer has to declare the data type for every data object. Typical data types are numeric, alphanumeric (a mixture of alphabetic letters), numbers and special characters, dates, and logical (true/false) data types. If data is assigned a particular data type, it can never be treated like another type. Thus alphanumeric data, like an address, can never be calculated.
Simple data types, some of which are also referred to as atomic types, include all types of numbers, and, usually all types of any data built into the specific programming language itself. In some languages, the user is allowed to create extensions of the Simple types. Although it is limited, these extensions will work as if they were built in. Generally, any type that can be returned as a value from a function operation can be considered a simple type. In algebra, a function is like a black box that does some type of operation on the data put into it. For example, for every value of x add the value one, as in the function y = x + 1. If the value of the variable is assigned to be 1, then y is equal to 2, and only two. There can be only one answer to a function operator.
The Java programming language has eight simple types that can be divided into four groups:
- Integers: "byte," "short," " int," and " long."
- Floating point, also known as real numbers--used when fractional precision is needed: "float" and "double." "Double" is used for transcendental functions like sine, cosine, and square root.
- Characters: "char" represents symbols a character set like letters and digits (a digit is a single number such as 1, 2, 3...). A character can represent a digit. An integer is a numeric value, such as 1, 2, 3, 4, 5, 6, and can contain one or more digits.
- Boolean: Boolean logic is a form of algebra where all values are reduced to either TRUE or FALSE. This type of logic is especially important to understanding computers because it fits comfortably with the binary numbering system, where each bit has a value of 0 or 1.
This is the complete article, containing 462 words
(approx. 2 pages at 300 words per page).