Java ID Value Create generateId()

Here you can find the source of generateId()

Description

generate Id

License

Open Source License

Declaration

public static String generateId() 

Method Source Code

//package com.java2s;
/*******************************************************************************
 * Copyright (c) 2011-2012 Nokia Corporation
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors://w w  w.j  a va  2s  .  c  o  m
 * Comarch team - initial API and implementation
 *******************************************************************************/

import java.util.Random;

public class Main {
    private static Random rng = new Random();

    public static String generateId() {
        int id = 1000000 + rng.nextInt(8999999);
        String sid = String.valueOf(id);
        return ("id" + sid);
    }
}

Related

  1. createID()
  2. createID()
  3. generateId()
  4. generateId()
  5. generateId()
  6. generateID(final String message)
  7. generateID(int seed)
  8. generateID(String origin)