Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

java import random

import java.util.Random;
Comment

import random java

import java.util.Random;

public class Selection
{    
  	public static void main(String[] args)    
    {       
        Random rand = new Random(); 
      	String[] animals = {"Dog", "Cat", "Fish", "Turtle", "Penguin"}; // array of animals
      	System.out.println("Console picked " + animals[rand.nextInt(animals.length)]); // prints the random animal selected from array
    }
}
Comment

PREVIOUS NEXT
Code Example
Java :: how to check if location is enabled android 
Java :: spring boot resource optional request param 
Java :: bukkit runnable 
Java :: jbutton remove selection border 
Java :: android glide dependencies 
Java :: java calculate fps 
Java :: how to make plugin wait spigot 
Java :: android back navigation 
Java :: set icon to fab programmatically in android studio 
Java :: check if string contains numbers 
Java :: android manifest internet permission 
Java :: java stream collect to string 
Java :: java how to generate guid 
Java :: java how to open a link 
Java :: javafx live date and time 
Java :: stackoverflow spring regex 
Java :: java date to string yyyy-mm-dd 
Java :: convert string to char array in java 
Java :: turn off focus border java 
Java :: material design android dependency androidx 
Java :: android studio constrainglayout 
Java :: android java get resource string 
Java :: spring jpa tree structure 
Java :: set drawableleft programmatically android 
Java :: java print type of object 
Java :: setText int java 
Java :: java close tcp socket output stream but not socket 
Java :: java switch class instanceof 
Java :: check type of variable java 
Java :: react native android gif 
ADD CONTENT
Topic
Content
Source link
Name
4+7 =