3 Replies Latest reply: May 28, 2010 11:23 AM by 3004 RSS

    java auto casting features?

    800386
      heys all, i was wondering if there are any auto cast features in java. (its something like the overriding widening cast operators in Vbnet)

      an example function that requires a Robot as a parameter:
      public void test(Robot arg1) {
      }
      i have a class Human, no it does not extend directly or indirectly from Robot. however i would like to do this:
      Human h1 = new Human();
      test(h1);
      // and the implicit conversion occurs in VB to transform human to a robot
      currently i had something like this (which is not what i want):
      Human h1 = new Human();
      test(h1.toRobot());