如果要实现你的目的应该这么写:
String strTempTest = "abc\tdef";
strTempTest = strTempTest.replaceAll("\t","\\\\");
out.println( strTempTest );