Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class ArrayGenerate {
- public static void main(String[] args)
- {
- arrayGenerator();
- arrayGenerator2();
- }
- public static String arrayGenerator()
- {
- int[] anArray;
- anArray = new int[5];
- for(int i = 0; i < anArray.length; i++)
- {
- anArray[i] = (char)(Math.random(90-65) + 65);
- }
- (for i = anArray.length; i > 0; i --)
- {
- anArray[i] = anArray[anArray.length-1];
- }
- return anArray;
- }
- public static String arrayGenerator2()
- {
- int[] anArray2;
- anArray2 = new int[5];
- for(int i = 0; i < anArray2.length; i++)
- {
- anArray2[i] = (char)(Math.random(90-65) +65);
- }
- return anArray2;
- }
- }
Add Comment
Please, Sign In to add comment