This page is no longer maintained — Please continue to the home page at www.scala-lang.org

Re: invoke method with an array using reflection

No replies
Seth Tisue
Joined: 2008-12-16,
User offline. Last seen 34 weeks 3 days ago.

>>>>> "Giovanni" == Giovanni De Facci writes:

Giovanni> Both mthd.invoke fail with the exception:
Giovanni> java.lang.IllegalArgumentException: object is not an instance
Giovanni> of declaring class
Giovanni> Is it the expected behaviour?

Yes. You need to tell the invoke method what object you want to invoke
it on: methd.invoke(pa,...)

Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland