Skip to content

Instantly share code, notes, and snippets.

@keithrbennett
Created August 18, 2012 00:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save keithrbennett/3383582 to your computer and use it in GitHub Desktop.
Save keithrbennett/3383582 to your computer and use it in GitHub Desktop.
Shows a JRuby implementation of a Java interface that surprisingly works with 'include' statement.
# Shouldn't this fail with the 'include Runnable' disabled?
require 'java'
java_import 'java.lang.Runnable'
class SampleRunnable
# include Runnable
def run
puts "I'm running!"
end
end
new_thread = java.lang.Thread.new(SampleRunnable.new)
new_thread.start
new_thread.join
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment