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

/* 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 :: Get the first day of the current month in Java 
Java :: java stack using linked list 
Java :: startactivityforresult deprecated android 
Java :: java how to make a gui 
Java :: worldedit set random blocks 
Java :: java stack 
Java :: how to iterate hashmap java 
Java :: create method setsupportactionbar 
Java :: turning a sentence to an array java 
Java :: Unrecognized option: --version Error: Could not create the Java Virtual Machine. Error: A fatal exception has occurred. Program will exit. 
Java :: spigot how to kill player 
Java :: android toast in adapter 
Java :: java calculate time difference 
Java :: Java debug log 
Java :: conditions in for loop java 
Java :: sort 2d array by column java 
Java :: java reverse linked list 
Java :: java xmx example 
Java :: how to change image resolution in android programmatically 
Java :: imageio class java 
Java :: android time 
Java :: change button text onclick java 
Java :: select max value from list java 
Java :: jframe border 
Java :: java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException 
Java :: what is use of static block in java 
Java :: java stream get list of one field 
Java :: How to swap two values in Java using a supporting method? 
Java :: try block in java 
Java :: start activity intent 
ADD CONTENT
Topic
Content
Source link
Name
7+2 =