Skip to content

Instantly share code, notes, and snippets.

@mikeebert
Created October 20, 2012 17:29
Show Gist options
  • Save mikeebert/3924142 to your computer and use it in GitHub Desktop.
Save mikeebert/3924142 to your computer and use it in GitHub Desktop.
method examples
// changes value but doesn't return anything. takes in two integers as arguments.
public void changeArrayValue(int indexToChange, int newValue) {
numbers[indexToChange] = newValue;
}
//changes value and returns new array
public int[] changeAndReturnUpdatedArray(int indexToChange, int newValue) {
numbers[indexToChange] = newValue;
return numbers;
}
//returns true and false
public boolean checkArrayLengthforForgetfulPeople(int lengthGuess) {
if (numbers.length == lengthGuess)
return true;
return false;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment