How to declare an array of different data types
<p>I am working on arrays in java and I have got a question.
I know that an array in java is a collection of similar data types, as shown below</p>

<pre><code>int[] x = new int[]{1,2,3};
</code></pre>

<p>Above declaration can be read as an Integer array which is a collection of integer types.</p>

<p>Consider this</p>

<pre><code>Object[] x = new Object[]{1,2,3,"srk"};
</code></pre>

<p>Here, can I say that above is an array which is a collection of dis-similar data types. 
Or<br>
It's an Object array of similar data types i.e.., objects. </p>

<p>I am muddled and skeptical about this.
In java, is it possible to create an array or any sort of collection which can hold different data types?</p>
