//  Data Structures with Java by John R. Hubbard
//  Copyright McGraw-Hill, 2001
//  Problem 5.2 on page 106

  public Bag(Object[] objects)
  { // constructs a bag containing the objects in the
    // given array and with twice the capacity
    this.objects = new Object[2*objects.length];
    for (int i=0; i<objects.length; i++)
      this.objects[size++] = objects[i];
  }
  