Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save AndyObtiva/3868634f402058a581e3bbaad8f26b8f to your computer and use it in GitHub Desktop.
Save AndyObtiva/3868634f402058a581e3bbaad8f26b8f to your computer and use it in GitHub Desktop.
# Example (nesting):
require 'nested_inherited_jruby_include_package'
class OuterClass
include_package java.util
class InnerClass
def initialize
p Arrays.asList(1, 2, 3)
end
end
end
OuterClass::InnerClass.new
# prints #<Java::JavaUtil::Arrays::ArrayList:0x233fe9b6>
# * * *
# Example (inheritance):
require 'nested_inherited_jruby_include_package'
class SuperClass
include_package java.util
end
class SubClass < SuperClass
def initialize
p Arrays.asList(1, 2, 3)
end
end
SubClass.new
# prints #<Java::JavaUtil::Arrays::ArrayList:0x7ce3cb8e>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment