Guest User

Untitled

a guest
Jul 23rd, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1.  
  2. public class ArrayGenerate {
  3. public static void main(String[] args)
  4. {
  5. arrayGenerator();
  6. arrayGenerator2();
  7. }
  8.  
  9. public static String arrayGenerator()
  10. {
  11. int[] anArray;
  12. anArray = new int[5];
  13. for(int i = 0; i < anArray.length; i++)
  14. {
  15. anArray[i] = (char)(Math.random(90-65) + 65);
  16. }
  17.  
  18. (for i = anArray.length; i > 0; i --)
  19. {
  20. anArray[i] = anArray[anArray.length-1];
  21. }
  22. return anArray;
  23. }
  24.  
  25. public static String arrayGenerator2()
  26. {
  27. int[] anArray2;
  28. anArray2 = new int[5];
  29. for(int i = 0; i < anArray2.length; i++)
  30. {
  31. anArray2[i] = (char)(Math.random(90-65) +65);
  32. }
  33. return anArray2;
  34. }
  35.  
  36. }
Add Comment
Please, Sign In to add comment