如何将一个文本文件倒置输出 请教各位,如何将一个文本文件倒置输出?谢谢 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 取出数据,放StringBuffer里。然后调用reverse()方法就可以了。 读出来然后reverse:BufferedReader br = null; StringBuffer sb = new StringBuffer();try { br = new BufferedReader(new FileReader("C:\\1.txt")); String temp = ""; while ((temp = br.readLine()) != null) { sb.append(temp); }} catch (IOException e) { throw new IOException(e.getMessage());} finally { if(fis != null) fis.close();}System.out.println(sb.reverse().toString()); 菜鸟问题,重定向 关于java线程的运作 一道题目 正则表达式引起CPU长时间表100%,请各位达人指点 KeyListener键盘监听被电脑抢了,怎么夺回来? JAVA中调整用存储过程 IE 不能正常浏览applet? 如何看懂javap编译的字节码,有相关资料吗? one question i do not know how 2do and what2do! 我想学java,曾经学过pb,会点vc,大概需要多长时间能达到一个中等的水平!我比较好学!谢谢! jfreechart做饼状图的问题? hashmap键值
BufferedReader br = null;
StringBuffer sb = new StringBuffer();
try
{
br = new BufferedReader(new FileReader("C:\\1.txt"));
String temp = "";
while ((temp = br.readLine()) != null)
{
sb.append(temp);
}
}
catch (IOException e)
{
throw new IOException(e.getMessage());
}
finally
{
if(fis != null)
fis.close();
}System.out.println(sb.reverse().toString());