正在加载图片...
String类 ends Witho方法 String[] filenames ="caterpillar. jpg cater.gif", bush. jpg",wuwu. jpg",clockmangifi System.out. print("过滤出jpq檔案:"); for (int i=0, i< filenames. length; i++) if(filenames [i]. endsWith(jpg")) System. out. print(filenames[i]+ System. out. println (")i code cho6filefilter iavaString类 • endsWith()方法 String[] filenames = {"caterpillar.jpg", "cater.gif", "bush.jpg", "wuwu.jpg", "clockman.gif"}; System.out.print("过滤出jpg檔案: "); for(int i = 0; i < filenames.length; i++) { if(filenames[i].endsWith("jpg")) { System.out.print(filenames[i] + " "); } } System.out.println(""); code\ch06\FileFilter.java
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有