CS 0007 Lecture Notes - Lecture 3: Primitive Data Type
Document Summary
A variable is a named storage location. A literal is a value that is written into program code. Basic building blocks provided by a programming language. They tell the compiler the size of a storage location. In a program, we declare what size of data we need by the choice of primitive data type and give each declaration a unique label, which will be used for future references. Each one varies in how many numbers it can store (the size of the value int (average) long (huge) that can be stored) Java supports two different primitive data types for storing real numbers float. Assignment: pi = 3. 14159f; must include float identifier id= In addition to the primitive numeric data types, java supports two non-numeric primitive data types: Boolean - true or false (important data type used in decision structures) A character is a single element of an alphabet. There are often mistakes in assigning contents to the wrong size variable.