import java.io.*; public class Translate { /** The String S, but with all characters that occur in FROM changed * to the corresponding characters in TO. FROM and TO must have the * same length. */ static String translate (String S, String from, String to) { char[] buffer = new char[S.length ()]; // NOTE: This try {...} catch is a technicality to keep Java happy. try { throw new IOException (); // REPLACE THIS LINE WITH THE RIGHT ANSWER. } catch (IOException e) { return null; } } // REMINDER: translate must // a. Be non-recursive // b. Contain only 'new' operations, and ONE other method call, and no // other kinds of statement (other than return). // c. Use only the library classes String, and anything containing // "Reader" in its name (browse the on-line documentation). }