Skip to content

Instantly share code, notes, and snippets.

@jweinst1
Created August 31, 2015 22:47
Show Gist options
  • Select an option

  • Save jweinst1/940f81350beced51ea15 to your computer and use it in GitHub Desktop.

Select an option

Save jweinst1/940f81350beced51ea15 to your computer and use it in GitHub Desktop.
Retrieving value from an Array in Java
import java.util.Arrays;
class Main {
public static void main(String[] args) {
System.out.println(checkvalue(thing, 2));
}
static int[] thing = {1, 2, 3};
static int checkvalue(int[] x, int y) {
return x[y];
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment