How to read a .txt as an argument for netbeans

102 Views Asked by At

I just finished an assignment for class and uploaded it to a website desgined to give the program the argument when uploaded and run. Since the site just shows your output and the coding goes "behind the scenes" just for the professor to read I cant see it actually running. I was wondering how I woud input an Args.txt file into netbeans so that I may know how to do it and test projects on my own in the future. Here is the output code for my file :

 public static void main(String[] args){
 In in = new In(args[0]);
 Graph G = new Graph(in);
 GraphProperties gp = new GraphProperties(G);

 System.out.println("diameter: " + gp.diameter());

System.out.println("radius: " + gp.radius());

System.out.println("center: " + gp.center());
} 

I tried putting it into properties but didn't get anywhere.

Thanks in advance!

0

There are 0 best solutions below