Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import java.util.ArrayList;

public class Main {
    public static String getArrayListInString(ArrayList<Integer> array) {
        String numbers = "";

        for (int i = 0; i < array.size(); i++) {

            numbers = numbers + array.get(i);

            if (i != array.size() - 1) {
                numbers = numbers + ", ";
            }

        }
        return numbers;
    }
}