Package test.containers

Examples of test.containers.UpperBoundedContainer


  {
    // Erasure replaces  UpperBoundedContainer(T object) constructor by
    // this one UpperBoundedContainer(IUpperTestBoundable object)
    // as a result only IUpperTestBoundable object can be used as
    // constructor arg raw type can't be instantiated
    UpperBoundedContainer cont = new UpperBoundedContainer(new UpperBounded());
   
    //  Both UpperBounded and lower bounded can be used in instance creation.
    //  Class generic type can't differ from constructor argument type. 
//    UpperBoundedContainer<UpperBounded> cont2 =
//      new UpperBoundedContainer<UpperBounded>(new LowerBounded());
//   
//    UpperBoundedContainer<LowerBounded> cont5 =
//      new UpperBoundedContainer<LowerBounded>(new UpperBounded());
   
    UpperBoundedContainer<UpperBounded> cont3 =
      new UpperBoundedContainer<UpperBounded>(new UpperBounded());
   
    UpperBoundedContainer<LowerBounded> cont4 =
      new UpperBoundedContainer<LowerBounded>(new LowerBounded());
   
    cont.print();
    cont3.print();
    cont4.print();
  }
View Full Code Here

TOP

Related Classes of test.containers.UpperBoundedContainer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.