chapter19n2.java

来自「JAVA源代码程序aashjkjhkjhkjhjkhkj」· Java 代码 · 共 34 行

JAVA
34
字号
/** * program to demonstrate simple handling of files */import java.io.* ;import java.util.* ;public class Chapter19n2    {    public static void main(String[] args) throws IOException	{        BufferedReader din =		 new BufferedReader(new InputStreamReader(System.in)) ;	System.err.print("type a file name: ") ;	System.err.flush() ;        String fileName = din.readLine().trim() ;	File file1 = new File(fileName) ;	System.err.print("the file '" + fileName) ;	if (file1.exists())	    System.err.println("' exists") ;	else	    System.err.println("' does not exist") ;	System.err.println("pathSeparator is **"				+ File.pathSeparator + "**") ;	System.err.println("pathSeparatorChar is **"				+ File.pathSeparatorChar + "**") ;	System.err.println("separator is **" + File.separator + "**") ;	System.err.println("separatorChar is **" + File.separatorChar + "**") ;	} // end of main method    } // end of class Chapter19n2

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?