Skip to content

Instantly share code, notes, and snippets.

@koichiro
Created March 3, 2010 16:46
Show Gist options
  • Save koichiro/320748 to your computer and use it in GitHub Desktop.
Save koichiro/320748 to your computer and use it in GitHub Desktop.
require 'java'
class RunCompare
import java.lang.Runnable
import java.util.Comparator
def compare(o1, o2)
o1 - o2
end
def run
puts "running..."
end
end
array = [10, 3, 1, 6, 2].to_java
java.lang.Thread.new(RunCompare.new).start
java.util.Arrays.sort(array, RunCompare.new)
p array.to_a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment