如果你要在控制台输出的话
System.out.println( value );

解决方案 »

  1.   

    两点想法:
    1. 类的名字应该以大写字母开头,虽然没有硬性规定,但这java命名规范的建议,是一个上品的程序应该做到的。
    2. 即使输出,也不会显示2.71828,因为这是一个double,会显示有很多位小数的数字,而且后面几位是不精确的。
      

  2.   

    import java.io.*;public class TestRWFile {
        public static void main(String[] args) {
            try {
                File file = new File("abc.txt");
                Writer fos = new FileWriter(file);
                PrintWriter pw = new PrintWriter(fos);            PrintWriter pw2 = new PrintWriter(new FileWriter(new File("123.txt")));
                pw.print("asdfasdfasdf");
                pw2.print("234ladf9");
                pw.close();            pw2.close();
                fos.close();        }catch(Exception e) {}
        }
    }