Java List from listOfStrings(int size, String prefix)

Here you can find the source of listOfStrings(int size, String prefix)

Description

list Of Strings

License

Open Source License

Declaration

public static List<String> listOfStrings(int size, String prefix) 

Method Source Code

//package com.java2s;
/*//from  w  ww  .j  a v a 2s  .com
 *   Copyright 2009 The Portico Project
 *
 *   This file is part of pgauge (a sub-project of Portico).
 *
 *   pgauge is free software; you can redistribute it and/or modify
 *   it under the terms of the Common Developer and Distribution License (CDDL) 
 *   as published by Sun Microsystems. For more information see the LICENSE file.
 *   
 *   Use of this software is strictly AT YOUR OWN RISK!!!
 *   If something bad happens you do not have permission to come crying to me.
 *   (that goes for your lawyer as well)
 *
 */

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

public class Main {
    public static List<String> listOfStrings(int size, String prefix) {
        ArrayList<String> list = new ArrayList<String>(size);
        for (int i = 1; i <= size; i++)
            list.add(prefix + i);

        return list;
    }
}

Related

  1. listOfExceptionsAsString(List exs)
  2. listOfIntegers2ArrayOfInts(List xs)
  3. listOfItems(List items, String separator, String finalConjunction)
  4. listOfOne()
  5. listOfOne(T x)
  6. listOfStrToString(List src, String del)