MCPcopy Create free account
hub / github.com/DuGuQiuBai/Java / main

Method main

day19/code/day19_File/src/cn/itcast_03/FileTest.java:19–36  ·  view source on GitHub ↗
(String[] args)

Source from the content-addressed store, hash-verified

17 */
18public class FileTest {
19 public static void main(String[] args) {
20 // ��װĿ¼
21 File folder = new File("d:\\");
22
23 // ��ȡ��Ŀ¼�����е��ļ������ļ��е�File����
24 File[] fileArray = folder.listFiles();
25
26 // ������File���飬�õ�ÿһ��File����
27 for (File file : fileArray) {
28 // ���ж��Ƿ����ļ�
29 if (file.isFile()) {
30 // �����ж��Ƿ���.jpg��β
31 if (file.getName().endsWith(".jpg")) {
32 System.out.println(file.getName());
33 }
34 }
35 }
36 }
37}

Callers

nothing calls this directly

Calls 1

getNameMethod · 0.45

Tested by

no test coverage detected