Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

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

public class Main {

    @SuppressWarnings("unused")
    public static String getRandomNumber(int count) {
        Random rdm = new Random(System.currentTimeMillis());
        String random = "";
        for (int i = 0; i < count; i++) {
            String str = String.valueOf((int) (Math.random() * 10 - 1));
            random = random + str;
        }
        return random;
    }
}