Recognizing extended class object
<p>In Java, I have a class <code>Num</code>, and a few classes that extend <code>Num</code>, like <code>Num_int</code> and <code>Num_double</code>.
I want to know whether it's possible for a method to recognize whether a given <code>Num</code> object is a <code>Num_int</code> or not.</p>

<p>I have the following code:</p>

<pre><code>void test(Num_int x) {
  System.out.println("int");
} // test
void test(Num x) {
  System.out.println("other");
} // test

Num_int A = new Num_int( );
Num B     = new Num_int( );
Num C     = new Num_double( );

test(A); // prints "int"
test(B); // prints "other"
test(C); // prints "other"
</code></pre>

<p>Unfortunately, the method "test" only prints "int" when A is given as argument.
I wan't the function to also print "int" when B is passed, since B is created via <code>Num B = new Num_int( );</code>. Is this possible?</p>

<p>Thanks.</p>
