title: Using an array of any Object as a parameter in java then using methods declared in both objects
body: <p>I have a method header as such</p>
  
  <pre><code>public static void test (Object[] queue) {
       queue.dequeue();
  }
  </code></pre>
  
  <p>Where Object will either be ArrayListQueue or LinkedListQueue and will store Strings in either case. In either case working written methods for dequeue have been written.</p>
  
  <p>I effectively would like the method to work like this</p>
  
  <pre><code>public static void test ( (ArrayListQueue or LinkedListQueue) [] queue) {
       queue.dequeue();
  }
  </code></pre>
  
  <p>Does anyone have any idea? Thank you.</p>
  
  <p>Edit : The Object can not implement an interface.</p>