This week's book giveaway is in the OCAJP forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide 1Z0-808 and have Jeanne Boyarsky & Scott Selikoff on-line! See this thread for details.
When i am executing the code below by the command
the output is Usage ShowFile File
java ShowFile TEST.TXT
output : FileNotFound
i don't understand the logic of this program, shall i create a file before executing a program or what ??
if yes then where shall i place the file, in the bin folder where jdk is installed ??
please help ??
As indicated the program should be run like java ShowFile C:/MyFolder/test.txt If you look at the code there are two Exceptions handled - one is to check whether you give the file name as a command line argument and the other to check if the given file exists. So please create the file before giving it as an argument.