CSC 222: Object-Oriented Programming
Spring 2012

Final Exam Review

Course goals:

Course content:

Object-Oriented Concepts design goals abstraction, object-focused, modularization classes/methods should be highly cohesive & loosely coupled Model-View-Controller (MVC) pattern class/object concepts class vs. object, fields & constructors & methods private vs. public, static, final interfaces & polymorphism List interface, Comparable interface, Collections.sort defining an interface, implementing an interface class hierarchies: e.g., Grade --> LetterGrade, passFailGrade inheritance & polymorphism derived class, parent class inheriting methods/fields, overriding methods IS-A relationship, polymorphism class hierarchies: e.g., BankAccount --> SavingsAccount, CheckingAccount instanceof, type casting Java Specifics types primitive types: int, double, char, boolean object types: String, Integer, Double, ... enumerated types expressions String: + math: +, -, *, /, %, +=, -=, *=, /=, %=, ++, -- boolean: ==, !=, >, <, >=, <=, &&, ||, ! statements assignment, print, return, if, if-else, while, for, for-each method calls: internal (this.METHOD()) vs. external (OBJ.METHOD()) exception handling: throws, try/catch libraries String, Character, Collections, Random, ... I/O formatted output: System.out.format, format strings Scanner: hasNext, next, hasNextLine, nextLine, hasNextInt, nextInt, ... FileWriter: write, close GUI-building in netBeans Data Structures arrays and ArrayLists advantages of ArrayLists over arrays methods: add, remove, set, get, size, ... parallel arrays/ArrayLists Dictionary example: add, contains, size, display implementation built on top of ArrayList, generic unsorted vs. sorted vs. "lazy" sorted versions Algorithms algorithm analysis big-Oh notation, rate-of-growth worst case vs. average case vs. best case performance searching & sorting sequential search O(N) vs. binary search O(N log N) Collections.binarySearch, List & Comparable interfaces insertion sort O(N^2) vs. selection sort O(N^2) vs. merge sort O(N log N) Collections.sort, Collections.shuffle recursion base case(s), recursive case(s) avoiding infinite recursion, Cat in the Hat analogy recursion vs. iteration: efficiency tradeoffs, redundancy simulations and modeling