我想問(wèn)你關(guān)于解釋下面程序中 args.length !=2 的幫助。在我讀過(guò)的書(shū)中,他們檢查是否有兩個(gè)文件,但為什么使用 ! 感嘆號(hào)?這對(duì)我來(lái)說(shuō)沒(méi)有意義。我已經(jīng)找到了關(guān)于 args.length 的信息,但即使在 stackowerflow 上也沒(méi)有找到關(guān)于這個(gè)檢查文件的信息,因此我在這里問(wèn)。謝謝你。java CopyFile first.txt second.txt - this is put on comand lineimport java.io.*;class CopyFile{ public static void main(String args[]) throws IOException{ int i; FileInputStream fileIn = null; FileOutputStream fileOut = null; **//firstly check whether both two files has been set up** if(args.length != 2) { System.out.println("Using: CopyFile system"); return; }
參數(shù) args.length 是什么意思?
慕碼人8056858
2021-06-04 14:41:36