CSC 221: Computer Programming I
Test 1 Review


Overview & history hardware vs. software historical generations mechanical -> vacuum tube -> transistor -> IC -> VLSI -> parallel & networks evolution of programming machine language -> assembly language -> high-level language Using Java classes loading a BlueJ project, creating an object, inspecting an object's state calling a method, parameters, data types (String, int, double, ...) Java class definitions fields define state; constructors initialize; methods implement behaviors public (class/constructor/methods) vs. private (fields) accessor vs. mutator methods, void methods comments (/** ... */ or // ..) variables and memory fields vs. parameters vs. local variables primitive (declare+assign) vs. object types (declare+construct+assign) Java statements assignment statement variables & associated memory cells assignment statements, expressions (using +,-,*,/), operator precedence mixed expressions (int & double, int/double & String), type casting arithmetic assignments: +=, -=, *=, /=, ++, -- output statement System.out.print, System.out.println, + operator return statement required in all execution paths of non-void method if statement conditional execution if (1-way), if-else (2-way) Boolean expressions comparison operators: ==, !=, <, >, <=, >= (= vs. ==) method calls internal: this.METHOD(PARAMETERS) vs. external: OBJECT.METHOD(PARAMETERS) parameter matching by order Object-oriented design goals abstraction, modularization, reusability