Skip to content

Instantly share code, notes, and snippets.

@RyanBreaker
Created May 19, 2012 17:51
Show Gist options
  • Save RyanBreaker/2731693 to your computer and use it in GitHub Desktop.
Save RyanBreaker/2731693 to your computer and use it in GitHub Desktop.
class Start
{
public static void main(String args[])
{
int a[] = {3,4,5,6,7};
change(a);
for(int i: a)
{
System.out.println(a);
}
}
public static void change(int x[])
{
for(int i: x)
{
x[i] += 5;
}
}
}
/*Exception Log
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 5
at Start.change(Start.java:19)
at Start.main(Start.java:7)
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment