CS 106A Lecture Notes - Lecture 17: Star Wars Day
Document Summary
Midterm grades will be out this weekend: assignment averages and midterm curve/ average will also be posted this weekend. May the 4th be with you (star wars day) To swap the values of two variables, you might want to create a temporary variable to store the value of one of the variables. Also when you call a method that accepts parameters and then changes them, the variables in the specific method do not alter the variables in the run method. Value semantics: behavior where values are copied when assigned, passed as parameters, or returned, for int and all primitive objects, those values do not change when they are called into methods and changed unless you return values. When you want to print an array, you need to change it to a string by calling array. tostring() This way, the array works for any number of students. To work this program, read the integer, store it as i, and then array[i]++