CSC152 2005S, Class 7: More Text-based Input and Output Admin * Reading for tomorrow: "Strings in Java" * Bounty remains (and I'm sorry for the pages that work incorrectly). * Picnic signup! * Please work in pairs! * Apologies: Java is pretty much "just do it this way" right now Overview: * Questions from last class? * Lab * Reflection (maybe) Some problems from last class * Need to declare names (variables) before you use them pen.println(userinput) won't work unless you've previously written String userinput; userinput = ... PrintWriter pen; pen = ...; * The order in which you perform operations is important userinput = eyes.readLine(); pen.print("Please enter your name: "); pen.flush(); * Some design decisions in Java are STUPID file.println("Hello"); // end program May not put anything in the file So you need to flush! * Capitalization matters (and is, unfortunately, inconsistent) * Classes use mixed case and begin with uppercase letters (new uppercase letter = new word) * Methods use mixed case and begin with lowercase letters Some lessons: * Java lets you overwrite files w/o complaining. * Java does not let you write to other people's directories