CS 18000 Lecture Notes - Lecture 1: Semicolon, Parsing, Camel Case
Document Summary
Top-level class: name of class is name of file (with . java extension, example: class robot in robot. java. Program execution begins at main: command line input and output. Input and output: files (including command line interaction) . Reading requires parsing : converting the bytes to internal representations (e. g. , a string of digits to binary) Writing requires formatting : converting from internal representations (e. g. , binary to a string of digits: complete i/o system is complicated in java deferred to later in the course. System class: has field members (variables) that reference the standard input and. Standard output files of the running java program. In command-line systems (e. g. , unix shell), these files can be the keyboard and display, or redirected from disk files or other programs: system. in: input stream, system. out: output stream. Parsing input: class scanner, to read from standard input, create a scanner object and use its methods: Scanner s = new scanner(system. in); int i = s. nextint(); double d = s. nextdouble();