Scala reflection with Int parameter
<p>In the below code, I try to invoke an object's method that has an Int parameter (giving it a value of 3). This returns an error that <code>Int</code> and <code>3</code> are incompatible types.</p>

<pre><code>//Using scala's Int does not work!
object MyObject{
  def handleInt(id:Int) : Boolean = {
    true
  }
}

object testApp extends App {
    val obj    = MyObject.getClass
    val method = obj.getDeclaredMethod("handleInt", classOf[Int]) //Int.getClass shows the same behavior
    val rsp    = method.invoke(obj, 3)
}
</code></pre>

<blockquote>
  <p>Error:(106, 41) the result type of an implicit conversion must be more
  specific than AnyRef</p>

<pre><code>    val rsp    = method.invoke(obj, 3)
</code></pre>
  
  <p>Error:(106, 41) type mismatch;  found   : Int(3)  required: Object</p>

<pre><code>    val rsp    = method.invoke(obj, 3)
</code></pre>
</blockquote>

<p>I tried modifying a lot of things here, the only way this could work is by changing all signatures to Java's <code>Integer</code>. The code will look like this:</p>

<pre><code>//This works with Java's Integer
object MyObject{
  def handleInt(id:Integer) : Boolean = {
    true
  }
}

object testApp extends App {
    val obj    = MyObject.getClass
    val method = obj.getDeclaredMethod("handleInt", classOf[Integer])
    val rsp    = method.invoke(obj, 3)
}
</code></pre>

<p><strong>My question(s) are:</strong></p>

<ol>
<li>Can someone explain why this happens? I <em>think</em> scala's <code>Int</code> wraps java's primitive <code>int</code> (which is why this is not considered an <em>object</em>), but I'm not sure.</li>
<li>Is there a way to achieve this using Scala's <code>Int</code> type?</li>
<li>Is it acceptable to mix scala and java types like this? Is it a good practice?</li>
</ol>