1 Reply Latest reply on Jan 26, 2013 3:15 AM by EJP

    Realized type from Inherited generic parent

      Lets say I have the following classes
      class Fruit
      class Orange extends Fruit
      class FruitVendor<T extends Fruit>
      class OrangeVendor<T extends Orange> extends FruitVendor
      What I want to do is create a class that can take a specific action on that type, that inherits from the parent. But I dont want to have to specify the generic type when I declare an instance.
      // What I must do
      OrangeVendor<Orange> vendor = new OrangeVendor<Orange>();
      // What I want
      OrangeVendor vendor = new OrangeVendor();
      How can I accomplish this?