Created
May 12, 2009 21:12
-
-
Save bkudria/110737 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
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
class JavaClass { | |
int magicNumber; | |
public JavaClass (int inputNumber) { | |
magicNumber = inputNumber + 1; | |
} | |
} |
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' | |
include_class "JavaClass" | |
demo = JavaClass.new(3) | |
class JavaClass | |
field_accessor :magicNumber | |
def add(number) | |
@sum = @magicNumber + number | |
end | |
def sum | |
@sum | |
end | |
end | |
demo.add(10) | |
puts demo.sum |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment