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 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 :: java get random char 
Java :: Display double in decimal places java 
Java :: java code to print hello world 
Java :: how to add minutes in date in java 
Java :: java prime 
Java :: java gui 
Java :: android studio textbox change text 
Java :: how to change background tint color programmatically android 
Java :: java int array 
Java :: Java program to find the sum of first 100 numbers 
Java :: how to round up in java 
Java :: java transfer file over socket 
Java :: java int to biginteger 
Java :: java rps 
Java :: sum of 1D array(JAVA) 
Java :: java int to string 
Java :: copy arraylist java 
Java :: java get sub array 
Java :: how to add elements to an array in java dynamically 
Java :: how to convert string to boolean in java 
Java :: get username from jwt token request spring boot 
Java :: java change text on click 
Java :: toast no android 
Java :: kotlin variable in string 
Java :: math.sin java 
Java :: bootstrap 4 modal get event related target 
Java :: check if number is odd java 
Java :: kmp java 
Java :: java get date in utc 
Java :: Caused by: java.lang.RuntimeException: No installed build tools found. Install the Android build tools version 19.1.0 or higher. 
ADD CONTENT
Topic
Content
Source link
Name
4+5 =