Android examples for java.util:Random
Returns a random digit [ 0-9 ].
//package com.java2s; import java.util.Random; public class Main { /**// www . j a v a 2 s. c o m * Returns a random digit [ 0-9 ]. */ public static char randomDigit() { Random r = new Random(); return (char) (r.nextInt(10) + '0'); } }