CSC152 2006S, Class 4: Beginning Java (And Eclipse) Admin: * Sorry about Wednesday. * Increase allowed absences by one * Today will be lecture and demo to prepare for Monday's lab. Future goal is less lecture, more lab. * Reminder: Book is optional. Copy in MathLAN. + I'll make sure that one is put here + I'll buy your copies at the end of the semester for $5.00 * No written homework for Monday; may want to review intro Java reading * Danny Zamora Overview: * Unix Q's? * Java history * Eclipse demo * Java basics /A Biased History of the Java Programming Language/ * Java is a platform-indepdent, object-oriented, programming language * Original design of Java was for embedded computers (in Cars, Toasters, etc.) * Need programs to be robust * Need to support large-scale program development * Nothing existing meets our needs - Design our own * Object-orienteation supports large-scale program development * Mistrusting programmers leads to more robust programs * Java as "programming language for the Web" led to initial success * Marketing, C-like syntax and decent OOP model led to continuing successk /Developing Java Programs/ * Configure your environment to use Eclipse * Set up directories for * Project * Package Three parts to a main method * Variable declarations - List the variables you will use in the program * A variable is a symbol that represent values * The symbol can represent different values across time * Must also *type* the variable - Say what kinds of things they refer to * Form: TYPE NAME ; * E.g., int x; java.io.PrintWriter pen; * Instructions to assign values to the variables * Form NAME = EXPRESSION * Basic expressions "asdfasdfasdf" // A string new NameOfClass(Parameters) // a new object in a particular class TeachingAssistant victim; victim = new TeachingAssistant("Eryn", "O'Neil", "Surly", "Casual"); * Requests to the invidivudal objects