Quantcast
Channel: CodeChef Discuss - latest questions
Viewing all articles
Browse latest Browse all 40121

Testing a Java program

$
0
0

I had developed my solution to work as "java Main in.txtout.txt", however I am receiving a "Wrong answer" message when a submit my solution.

In the FAQ I have found that I must test using java test < in.txt> out.txt, but I do not understand what is the purpose of "<" and ">". The FAQ says that "...< and > to redirect the streams" but that do not makes much sense, my Java program takes "<" and ">" as arguments as well.

Besides, in the Wiki, there is a sample for Java solutions:


java.io.BufferedReader r = new java.io.BufferedReader (new java.io.InputStreamReader (System.in));

String s;

while (!(s=r.readLine()).startsWith("42")) System.out.println(s);


And I do not see that they use the input parameter "< in.txt>" anywhere.

Regards


Viewing all articles
Browse latest Browse all 40121

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>