In a partial answers to the last posting, I'll just chime in that you can just input a "x"-coordinate for the input and TextDemo does not declare such input as an error because the "y"-coordinate (of primitive type int) of the inputted for class TextDemo should be initialized to 0 (as is good programming practice) and therefore defaults to 0 when the user inputs only a "x"-coordinate for the input.
2 things though: 1. My comment is not to say that we should not catch others types of errors (e.g. entering "4" or "4,0 as a coordinate, which leads to my 2nd point, that 2. the question, "What defines an 'error?'" is the same as that which the post immediately above this one asks which is why I could only partially answer the post immediately above this one.
Therefore, I await the TA's or professor's (more) complete answer. |