CS 0007 Lecture Notes - Lecture 3: Primitive Data Type

42 views2 pages
10 Oct 2017
School
Course

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.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents