/* Using string class. Jumbling letters of a string */ import java.io.*; class Jumble { public static void main (String[] args) throws IOException { String word; // String word = new String(); char first, last; BufferedReader stdin; stdin = new BufferedReader (new InputStreamReader (System.in)); System.out.print ("Type a word: "); word = stdin.readLine(); System.out.println ("Jumbling letters..."); first = word.charAt(0); last = word.charAt(word.length()-1); word = word.replace (last,'\0'); word = word.replace (first, last); word = word.replace ('\0',first); System.out.println (word); } }