Random Material Color Selector
an anonymous user
·
Java
·

import java.util.*; import java.lang.*; import java.io.*; // The main method must be in a class named "Main". class Main { public static void main(String[] args) { final String[] color_noun = {"Amber", "Blue", "Blue Grey", "Brown", "Cyan", "Deep Orange", "Deep Purple", "Green", "Grey", "Indigo", "Light Blue", "Light Green", "Lime", "Orange", "Pink", "Purple", "Red", "Teal", "Yellow" }; final String[] color_number = {"50", "100", "200", "300", "400", "500", "600", "700", "800", "900"}; Random random = new Random(); int indexNoun = random.nextInt(color_noun.length); int indexNumber = random.nextInt(color_number.length); System.out.println(color_noun[indexNoun]+"-"+color_number[indexNumber]); } }
Click on the Run button to get started.
The code/input has changed since you last clicked on Run. Click it
again to see the updated changes.
Comments