Created
April 2, 2020 04:34
-
-
Save AndyObtiva/3868634f402058a581e3bbaad8f26b8f 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
# 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