2

I still don't feel like this is adequately answered. how does one do this in jruby:

MyClass myobj = new MyClass;
InheritsFromMyClass changedobj = (InheritsFromMyClass)myobj;

1 Answer 1

1

Since Ruby is a dynamically typed language you do not need to cast the type:

myobj = MyClass.new
changedobj = myobj
Sign up to request clarification or add additional context in comments.

2 Comments

what happens when changedobj.method_that_is_only_on_inherits_from_my_class
i think this question is stemming from my complete lack of java knowledge. It works, thank you

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.