data - Data Types The objects about which computer programs...

Info iconThis preview shows pages 1–6. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Data Types The objects about which computer programs compute is data. We often think first of integers. Underneath it all, the primary unit of data a machine has is a chunks of bits the size of a word. (The usual size of a word in hardware is 32, so 2 32 = 4 , 294 , 967 , 296 different objects can be represented.) But a language can organize the bits into varieties called data types. With different data types the same bit pattern might represent a different object. A language can provide assistance in computing with these data types giving the illusion or the abstraction of computing with complex objects like real numbers, sound, video, graphs, etc. Data Types I The eight primitive data type in Java I twos complement, IEEE754 I Definition: objects are everything but primitives I The wrapper classes: java.lang.Boolean , Character , Float , etc. I java.math.BigInteger , java.math.BigDecimal I Strings: java.lang.String , and java.lang.StringBuilder , but do no use java.lang.StringBuffer . I Arrays and its wrappper class java.util.Arrays I Characters: Unicode Java Data Types In Java the data types are divided into two families: primitive data types and objects. Java Primitive Data Types The primitive data types (of which there are eight in Java) are those data types with simple structure and can be represented in the 32 or 64 bits of hardware, for example int and long . The operations on the primitive data types usually have hardware support. So computing with primitive data types is typically fast and convenient. These data types are used a lot in computing, though as computers get more powerful, programmers get more knowledgeable, and APIs get more expressive, it is more and more common for programs to use complex data types. Java Objects The other families of data types in Java are called objects. (This is another use of the overworked word object. In Java jargon an object is a specific category of data types: namely all those that are not primitive.) Common Java objects are arrays and strings....
View Full Document

This note was uploaded on 02/10/2012 for the course CSE 1002 taught by Professor Marico during the Spring '08 term at FIT.

Page1 / 29

data - Data Types The objects about which computer programs...

This preview shows document pages 1 - 6. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online