title: Initialize arguments of two types
body: <p>I wrote a method that takes an argument of either <code>Taxi</code>type or <code>Shuttle</code> type. Here is it main idea :</p>
  
  <pre><code>public boolean requestPickup(Passenger passenger, Class&lt;?&gt; vehicleClass){
          Taxi taxi = scheduleTaxi();
          if(taxi != null) {
              taxi.setPickupLocation(passenger.getPickupLocation());
              return true;
          }
          else {
              return false;
          }
  }
  </code></pre>
  
  <p>Can someone please explain to me how can an arguments of two types be initialized?</p>
  
  <p>Thanks</p>