1 String str="1234567890qwertyuioplkjhgfdsazxcvbnmQWERTYUIOPLKJHGFDSAZXCVBNM "; 2 int b[]=new int[4]; 3 Random a =new Random(); 4 for(int i=0;i<4;i++) 5 { 6 b[i]=a.nextInt(62); 7 System.out.print(str.substring((b[i]),(b[i]+1) )+" "); 8 }
1 String str="1234567890qwertyuioplkjhgfdsazxcvbnmQWERTYUIOPLKJHGFDSAZXCVBNM "; 2 int b[]=new int[4]; 3 Random a =new Random(); 4 for(int i=0;i<4;i++) 5 { 6 b[i]=a.nextInt(62); 7 System.out.print(str.substring((b[i]),(b[i]+1) )+" "); 8 }