Lecture 18, CS 302-7 and 8, March 2 2012

 

  1. Reminders
    1. Exam 1 – March 8

                                                               i.      By end of class today – will have covered everything on exam

1.      no 2d arrays on exam

    1. Program 2 – March 16

                                                               i.      Pairs by march 9

  1. Review
    1. Variable scope
    2. Call stack tracing
    3. Arrays as parameters
  2. Passing arrays
    1. Last time, we used an array as a parameter
    2. You can also return arrays:
    3. Example - PassingAndReturning.java
    4. Example – ArrayPassing.java
    5. Side note – Strings are kind of weird

                                                               i.      They are objects (not primitives) but they behave like primitives when we pass them with methods.

                                                             ii.      They are what’s referred to as immutable.

  1. 2d arrays

                                                               i.      example – chess board

  1. HW – program 2, study for exam