COMS W1004 Lecture 5: types (as PDF).pdf

37 views1 pages

Document Summary

4:23 pm int x = 3; x = 5; int y; y = 7; int z = x + y; //z has value of 12. int has 4 bits x = 2; y = -1; Types long a; //twice the number of bits of an integer float b = 3. 0; //decimal numbers double c; //instead of 4 bits, 8 bits. Can represent a more precise decimal number than a float byte d; //8 bits, smallest data type boolean e; //true or false, takes 1 byte char letter = "c"; //individual letters, 2 bytes (1st byte is askey)

Get access

Grade+
$40 USD/m
Billed monthly
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
10 Verified Answers
Class+
$30 USD/m
Billed monthly
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
7 Verified Answers

Related Documents