Skip to content

Instantly share code, notes, and snippets.

@theleoborges
Created January 27, 2011 13:04
Show Gist options
  • Save theleoborges/798478 to your computer and use it in GitHub Desktop.
Save theleoborges/798478 to your computer and use it in GitHub Desktop.
#ruby
> a = [0]
> i = 0; for i in 0...(a.size) do; puts "in the loop"; end
> puts i
Produces:
# in the loop
# 0
//java
int[] a = new int[]{1};
int i;
for(i=0; i<a.length; i++)
System.out.println("in the loop");
System.out.println(i);
Produces:
// in the loop
// 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment