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+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