CS 0401 Lecture Notes - Lecture 2: Primitive Data Type, Javac, Java Class Library

31 views3 pages
30 Aug 2016
School
Course

Document Summary

We have to indicate to java what type of data our input is. Integers never legal to hold something like 3. 4 (forbidden) Binary basics example: in normal number system we use decimal. Binary uses base of 2 example: 22 in binary is 10110. Call 10110 each digit is called a binary digit but for short, we"ll call them bits so each bit is a place where we write 1 or 0. 8 bits in a row is a byte. How many ways can we write a year. Total: 10000 possible ways to write years = 10^4. 2^7-1 = 127 (use one of the boxes for + or -) If i can"t store something infinite, let"s chop it off at some point. However because of this, precision is lost 8( Not a primitive data type boolean true or false size? (at least 1 bit)

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