Given:
3. public class Main { 4. public static void main(String[] args) { 5. int i = 4; 6. int j = 1; 7. /*from w ww .ja va 2 s . c o m*/ 8. assert(i > Integer.valueOf(args[0])); 9. assert(j > Integer.valueOf(args[0])): "error 1"; 10. assert(j > i): "error 2": "passed"; 11. } 12.}
And, if the code compiles, given the following two command-line invocations:
Which are true? (Choose all that apply.)
A and D are correct.
The syntax on line 10 is invalid and will not compile.
The assert statements on lines 8 and 9 are testing the arguments of a public method, which is considered an inappropriate use of assertions.
If the syntax on line 10 was fixed, then option C would be correct.