Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import java.util.ArrayList;

import java.util.List;

public class Main {
    public static List<String> GetNumbersList(int from, int to) {
        if (from > to) {
            return null;
        }

        List<String> numberList = new ArrayList<String>();

        for (int i = from; i <= to; i++) {
            numberList.add(Integer.toString(i));
        }

        return numberList;
    }
}