Listing last 3 items (or all if less than 3) in an ArrayList
Is a best practice to define a variable as type of the interface the instance implement it(see OOP principles)
Just a little bit out of scope, you can declare your arrayList inline, like in the example I wrote.
Try to use available features of List(in this example) like subList rather than cycle(what if you have thousands of elements?)
toString on a list will return a string with those list, you don't have to concatenate them
it is a bad practice to concatenate strings in cycles because create new strings every time you add + " "


See an alternative solution below:

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

public class MainTest {
    public static void main(String[] args) {
        final int wantedSize = 3;
        final List&lt;String&gt; arrayList = new ArrayList&lt;&gt;(Arrays.asList("item1", "item2", "item3", "item4"));
        final int listSize = arrayList.size();
        final List&lt;String&gt; result = (listSize &gt;= wantedSize) ? arrayList.subList(listSize-wantedSize, listSize): arrayList;
        System.out.println(result.toString());
    }
}