展开全部
public static void main(String[] args) throws IOException {
File file = new File("E:/JavaExercise/eclipse-workspace/0801/src");
File[] files = file.listFiles();
// FileInputStream fis = new FileInputStream(file + "/");
FileInputStream fis = null;
if (files != null && files.length>0) {
for (File f : files) {
if (f.isFile()) {
fis = new FileInputStream(file + "/" + f.getName());
}
}
byte[] b = new byte[files.length];
int c = 0;
for (File f : files) {
if (f.isFile() && f.getName().endsWith(".java")) {
while ((c = fis.read(b, 0, b.length)) != -1) {
System.out.println(b);
}
}
}
}
}
File file = new File("E:/JavaExercise/eclipse-workspace/0801/src");
File[] files = file.listFiles();
// FileInputStream fis = new FileInputStream(file + "/");
FileInputStream fis = null;
if (files != null && files.length>0) {
for (File f : files) {
if (f.isFile()) {
fis = new FileInputStream(file + "/" + f.getName());
}
}
byte[] b = new byte[files.length];
int c = 0;
for (File f : files) {
if (f.isFile() && f.getName().endsWith(".java")) {
while ((c = fis.read(b, 0, b.length)) != -1) {
System.out.println(b);
}
}
}
}
}
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询