How Can I Print Values and Index Numbers of an ArrayList without a Loop?
<p>Here is my code so far:</p>

<pre><code>import java.util.ArrayList;

public class BasicArraylists0 
{
    public static void main(String[] args) 
    {
        ArrayList arrayList = new ArrayList();

        arrayList.add(-113);
        arrayList.add(-113);

        System.out.println(arrayList); // prints [-113, -113]
    }
}
</code></pre>

<p>I want to code so that it prints values, -113s in this case, and index without any brackets without using any for or while loop?</p>

<p>For example, I would like to print something like </p>

<p>"Slot 0 has a -113"
"Slot 1 has a -113"
and so on.</p>

<p>Okay, here is the question:</p>

<p>"Create an ArrayList that can hold Integers. Add ten copies of the number -113 to the ArrayList. Then display the contents of the ArrayList on the screen.</p>

<p>Do not use a loop. Also, do not use any variable for the index; you must use literal numbers to refer to each slot."</p>