Java Random Number getPhoneNumber()

Here you can find the source of getPhoneNumber()

Description

get Phone Number

License

Open Source License

Declaration

public static String getPhoneNumber() 

Method Source Code

//package com.java2s;
/*//from w  w w.  java 2s  . com
 * All GTAS code is Copyright 2016, Unisys Corporation.
 * 
 * Please see LICENSE.txt for details.
 */

import java.util.Random;

public class Main {
    public static String getPhoneNumber() {
        return "0011" + getRandomNumber(9) + getRandomNumber(9) + getRandomNumber(9) + getRandomNumber(9)
                + getRandomNumber(9) + getRandomNumber(9) + getRandomNumber(9) + getRandomNumber(9)
                + getRandomNumber(9) + getRandomNumber(9);
    }

    public static int getRandomNumber(int bound) {
        Random random = new Random();
        return random.nextInt(bound);
    }
}

Related

  1. getNumberInRange(int minimum, int maximum)
  2. getNumberLong()
  3. getNumbers()
  4. getNumbersAndAlphabet()
  5. getNumString(int length)
  6. getPositiveNumber(int maximum)
  7. getRandNum(int charCount)
  8. getRandNum(int num)
  9. getRandNum(int num)