day3.21cse110

day3.21cse110 - Chapter 2 Data and Expressions Primitive...

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

View Full Document Right Arrow Icon
Chapter 2 Data and Expressions
Background image of page 1

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

View Full DocumentRight Arrow Icon
Primitive Data Types
Background image of page 2
Primitive Data 2- 3 There are eight primitive data types in Java Four of them represent integers: byte , short , int , long Two of them represent floating point numbers: float , double One of them represents characters: char And one of them represents boolean values: boolean
Background image of page 3

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

View Full DocumentRight Arrow Icon
Numeric Primitive Data 2- 4 The difference between the various numeric primitive types is their size, and therefore the values they can store: Type byte short int long float double Storage 8 bits 16 bits 32 bits 64 bits 32 bits 64 bits Min Value -128 -32,768 -2,147,483,648 -9 x 10 Max Value 127 32,767 2,147,483,647 9 x 10 - 1
Background image of page 4
Characters and Boolean 2- 5 A char variable stores a single character Character literals are delimited by single quotes: 'a' 'X' '7' '$' ',' '\n' • A boolean value represents a true or false condition • The reserved words true and false are the only valid values for a boolean type
Background image of page 5

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

View Full DocumentRight Arrow Icon
Data Variables
Background image of page 6
Image of page 7
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 12/08/2010 for the course CSE 110 taught by Professor Kim during the Spring '08 term at ASU.

Page1 / 12

day3.21cse110 - Chapter 2 Data and Expressions Primitive...

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

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