The reason why this won't print "spam":
String moose = "ape";
String ape = "smew";
String smew = "cat";
String cat = "moose";
String malarkey = "";
malarkey += (cat.charAt(3)+moose.charAt(1)+
        smew.charAt(1)+ape.charAt(1));
System.out.print(malarkey);