Q:

Java: How to get rid of only some numbers in a list?

I don't really know how to explain this but i can show. The goal i want to accomplish is that the first loop produces numbers 1,2,3,4,5. Then the second loop produces numbers 1,2,3,4,5,6,7,8,9. I want this second loop to output the numbers 6,7,8,9. Then in the third loop it would output 10,11,12,13,14,15. Now how would I go by doing this?
                int horse= 5

        for (int w =1; w <= horse; w++)
        {
            System.out.println(w + " The first loop");
        }

        int test= horse + 4;

        for (int w =1; w <= test; w++)
        {
            System.out.println(w + " The second loop");

        }

        int try = test + 6;

        for (int w =1; w <= try; w++)
        {
            System.out.println(w + " The third loop");
        }

A:

Don't reinitialize your w variable back to 1 each time. You can do this simply by omitting it.
    int horse= 5;
    int w;
    //loop from 1 to 5
    for (w =1; w <= horse; w++)
    {
        System.out.println(w + " The first loop");
    }

    int test= horse + 4;
    //loop from 6 to 9
    //here the initial value of w is 6 from the previous loop
    for (; w <= test; w++)
    {
        System.out.println(w + " The second loop");

    }

    int try0 = test + 6;
    //loop from 10 to 15
    //here the initial value of w is 10 from the previous loop
    for (; w <= try0; w++)
    {
        System.out.println(w + " The third loop");
    }

Note that try is a reserved system keyword, so rename it to something like try0

