java - Multiple files argument to main function -
i want process multiple text files ( eg. compare 2 files) , pass files argument main function. how do ? how pass multiple files arguments command line?
import java.io.file; class multifileapp { public static void main(string[] args) { // read file 1 // read file 2 //process file 1 & 2 } }
java yourapp file1.txt file2.txt
those strings can accessed in main
args[0]
& args[1]
.
Comments
Post a Comment