Skip to content

Instantly share code, notes, and snippets.

@jasper-lyons
Last active January 4, 2016 20:09
Show Gist options
  • Save jasper-lyons/8672322 to your computer and use it in GitHub Desktop.
Save jasper-lyons/8672322 to your computer and use it in GitHub Desktop.
class SomeClass {
public int someMethod(int[] data) {
//do some things
}
public int someMethod(Integer[] data) {
// this bit convert an Integer array into an int array.
int[] newData = int[data.length];
for (int i = 0; i < data.length; i++) {
newData[i] = data[i].intValue();
}
// this bit jsut calls the already defined method.
return this.someMethod(data);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment