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, char, boolean) 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 // ..) 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), cascading if-else (multi-way) Boolean expressions comparison operators: ==, !=, <, >, <=, >= (= vs. ==) logical connectives: && (AND), || (OR), ! (NOT) method calls internal: METHOD(PARAMETERS) vs. external: OBJECT.METHOD(PARAMETERS) parameter matching by order Variables and memory fields vs. parameters vs. local variables scope (fields = class, parameters/locals = method) static fields, final fields (constants) primitive (declare + assign) vs. object types (declare + construct + assign) Object-oriented design goals abstraction, modularization, reusability