CS 0401 Lecture Notes - Lecture 4: Baud, Input Device
Document Summary
Stream a source or a destination for data, defined as a sequence of bites you can only read to byte by byte: the keyboard takes input from the user, disk file. Scanner and print functions: console i/o (by default) input: keyboard, output: screen. *; (or java. util. scanner;) the star will give you access to everything in the utilities package (including random class, *; - (read and write from files: public class io, system. out. println( hello world ); - prints to the screen, the ln will automatically create a new line. Without the ln, the text will continue onto the same line int x = 10, y = 5: system. out. println( x+y= + x + y ); Makes the int values into a string because in a println function: operators will not work inside strings. Remember to use parentheses (left to right, inner to outer: double pi = 3. 1415926, system. out. println( pi ); How to round? (will not just chop off, it will round)