1

Say I have a java library with the following pseudo code :

abstract class B {
 public void method2(String param2) {...}
}
class A extends B {
 public void method1(String param1) {...}
}

I want to use this from Clojure.

I have an instance of A, and I want to invoke method2 without going through Reflection methods.

What's the quickest way ?

asked Jul 3, 2014 at 6:10
0

1 Answer 1

2

If you have an instance of A you can just call method2 using normal interop:

(.method2 (A.) "param")
answered Jul 3, 2014 at 9:52
Sign up to request clarification or add additional context in comments.

1 Comment

I am going to mark your answer correct regarding my own question; my real problem was that the method was actually protected not public, so I had to go through reflection.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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.