Created
March 3, 2010 16:46
-
-
Save koichiro/320748 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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