import java.io.*;
public class wrenwren
{
public static void main(String args[])
{
try
{
File f = new File("jdk1.5.0_06\bin","wren.java");
}
catch (Exception ex) { }
System.out.println(f.getCanonicalPath()); }
}
红的有问题,上网差了,没有问题啊,怎么回事呢?
public class wrenwren
{
public static void main(String args[])
{
try
{
File f = new File("jdk1.5.0_06\bin","wren.java");
}
catch (Exception ex) { }
System.out.println(f.getCanonicalPath()); }
}
红的有问题,上网差了,没有问题啊,怎么回事呢?
public static void main(String args[])throws Exception {
File f = new File("jdk1.5.0_06\bin", "wren.java"); System.out.println(f.getCanonicalPath()); }
}或者,你把打印也放在try里