Skip to content

Instantly share code, notes, and snippets.

@kf4x
Created September 16, 2012 05:32
Show Gist options
  • Save kf4x/3731128 to your computer and use it in GitHub Desktop.
Save kf4x/3731128 to your computer and use it in GitHub Desktop.
cool java bytes
//Want to remove element and who what element you removed
temp = element[size - 1];
size--;
return temp
//this will return size of array then decrement
return element[--size];
public boolean checker(){
return size == 0;
}
//create a temp array with double the length
int[] = new int[elements.length * 2];
//method to copy array
System.arraycopy(sourceArray, offset, target(temp), offset, elementsToCopy);
//reinitialize
elements = temp;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment