[Java] import java. util. imports; import java. io. file; import java. io. fileReader; public class EX1_2 {public static void main (String [] args) throws Exception {char [] array = new char [500]; // defines the largest array used to store the characters in the file, namely, bytes input = new bytes (System. in); System. out. print ("enter the name of the file you want to test:"); String FileName = input. next (); int s = 0, I = 0, t, j, n, k; FileReader input1 = new FileReader (new File (FileName); while (t = Indium Ut1.read ())! =-1) {array [I] = (char) t; I ++;} System. out. println ("the number of characters in the file is:" + I); n = I; boolean frag; for (I = 0; I <n-1; I ++) {frag = true; for (k = 0; k <I; k ++) {if (array [k] = array [I]) {frag = false; break ;}} if (frag) {System. out. print (array [I] + "frequency:"); s = 1; for (j = I + 1; j <n; j ++) {if (array [I] = array [j]) s ++;} System. out. println (s );}}}}