{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

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

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

View Full Document Right Arrow Icon
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.
Image of page 1

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

View Full Document Right Arrow Icon
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
Image of page 2
Java Data Types In Java the data types are divided into two families: primitive data types and objects.
Image of page 3

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

View Full Document Right Arrow Icon
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.
Image of page 4
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.
Image of page 5

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

View Full Document Right Arrow Icon
Image of page 6
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern