Nicolas Modrzyk
Nicolas Modrzyk

Reputation: 14187

Calling java parent method from Clojure

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 ?

Upvotes: 1

Views: 188

Answers (1)

sw1nn
sw1nn

Reputation: 7328

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

(.method2 (A.) "param")

Upvotes: 1

Related Questions