”黑马程序员“编写一个可以获取文件扩展名的函数,形参接收一个文件名字符串,返回一个扩展名字符串。_"cv == null ? \"\" : path.substring(path.indexof(\-CSDN博客

网站介绍:文章浏览阅读3.1k次。第一种方法:package test;import java.io.*;public class seven {public static void main(String[] args)throws IOException {System.out.println( getPath( "演示="+"abc.java"));System.out.println("请从键盘上随_"cv == null ? \"\" : path.substring(path.indexof(\".\") + 1) +"