Java使用文件类 Java创建一个字符串 Java反转给定字符串 Java使用文件类 import java.io.File; public class FileDemo { public static void main(String[] args) { File f = null; String[] strs = {"test1.txt", "test2.txt"}; try { for(String s:strs ) { f = new File(s); boolean bool = f.canExecute(); String a = f.getAbsolutePath(); System.out.print(a); System.out.println(" is executable: "+ bool); } } catch (Exception e) { e.printStackTrace(); } } } Java创建一个字符串 Java反转给定字符串