Check out example codes for "java read file from command line argument". It will help you in understanding the concepts better.

Code Example 1

import java.util.Scanner;
import java.io.File;
Scanner input = new Scanner(new File(args[0])); //Where args[0] is the cmd argument, the file name

Learn ReactJs, React Native from akashmittal.com