CS 0401 Lecture Notes - Lecture 2: Primitive Data Type, Javac, Java Class Library
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)