java P2 < X.java
should have the same behavior as if one compiles X.java with javac, and then interpretes X.class with java.
Note, your program must take input from standard input and write to standard output (so that we can use the redirection).
A sample Main.java can be found here.
Grading policy
Your homework will be graded for a total of 100 marks. Of these 50 marks will be for the
public testcases, 10 marks for the contributed testcases, and 40 marks for the TAs testcases.