JRuby

JRuby is quite a sweet thing. I started playing around a bit with it today and did this stupid program:

require “java”

include_class “java.util.Random”

5.times do |i|
random = Random.new
print “#{random.nextInt}\n”
end

As I said, a stupid program, but it shows how to access Java classes from inside of Ruby.