My program is printing random weird characters.
Here is tester/** * Write a description of class LandonLoweCipher here. * * @author (Landon) * @version (a version number or a date) */ import java.io.PrintWriter; import java.io.File; import java.util.*; public class LandonCipher { // instance variables - replace the example below with your own private static String phrase; private static String newPhrase; private static final char[] alpha = {'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'}; private static char[] newAlpha; /** * Constructor for objects of class LandonLoweCipher */ public LandonCipher(String p) { // initialise instance variables phrase = p; newPhrase = ""; newAlpha = new char[26]; } public static char[] newAlphabet() { Random rn = new Random(); int ran = 0; // loop adding random int to array for (int i = 0; i < alpha.length; i++) { ran = rn.nextInt(26); newAlpha[i] += alpha[ran]; //tests whether the random letter is already in array for(int a = 0; a < newAlpha.length; a++) { if(newAlpha[i] == newAlpha[a]) { ran = rn.nextInt(26); newAlpha[i] += alpha[ran]; } } } return newAlpha; } public static String newPhrase() { phrase = phrase.toLowerCase(); for (int i = 0; i < alpha.length; i++) { for (int a = 0; a < phrase.length(); a++) if(phrase.charAt(a) == alpha[i]) newPhrase += newAlpha[i]; } return newPhrase; } }