Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

create a random char java

import java.util.Random;

public class RandomChar {
    public static void main(String[] args) {
        Random random = new Random();

        char randomizedCharacter = (char) (random.nextInt(26) + 'a');
        System.out.println("Generated Random Character: " + randomizedCharacter);

    }

}
Comment

java get random char from alphabet

/* import java.util.Random; */
Random r = new Random();

char c = (char)(r.nextInt(26) + 'a');		// lowercase
char c = (char)(r.nextInt(26) + 'A');		// uppercase
Comment

PREVIOUS NEXT
Code Example
Java :: print queue in java 
Java :: murtaza jafari 
Java :: java hello world 
Java :: java 2d array loop 
Java :: java alert box 
Java :: how to set title in center in toolbar in android 
Java :: java boolean 2d array 
Java :: What is null mean in java 
Java :: convert int to double with 2 decimal places java 
Java :: instantiate matrix java 
Java :: java 2d array for each 
Java :: string array to arraylist 
Java :: scanner check if int 
Java :: java game 
Java :: java localtime format 
Java :: how to reverse a string in java 
Java :: How to perform a breadth first search through a binary tree, in Java? 
Java :: convert int to string java 
Java :: how to add elements in array in java using for loop 
Java :: array liste java 
Java :: how to print multiple things in one line java 
Java :: change button text java 
Java :: Java tree from star 
Java :: get type java 
Java :: create stream from array java 
Java :: check have string have just numbers 
Java :: calculator with java 
Java :: java create list integer range 
Java :: difference between access specifiers and access modifiers in java 
Java :: add view to relativelayout programmatically 
ADD CONTENT
Topic
Content
Source link
Name
5+3 =