Password

import java.util.*; public class Password{ public static void main(String arg[]){ String[] al = {"a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","0","1","2","3","4","5","6","7","8","9"}; ArrayList<String> pass = new ArrayList<String>(); int num = (int) (Math.random() * 10) + 1; int upper = 100; int lower = 50; int r = (int) (Math.random() * (upper - lower)) + lower; int num2 = (int) (Math.random() * 8) + 0; int num3 = (int) (Math.random() * 8) + 0; for (int i = 0; i < 8; i++){ int ran = (int)(Math.random() * 36) + 0; if (i == num3) { al[ran] = num + ""; } if (i == num2){ ran = num; pass.add(al[ran].toUpperCase()); } else{ pass.add(al[ran]); } } System.out.println(pass); } }

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.