In Java, why does
System.out.println(11+16/4*2+ (4+">")+4*2);
result in a compiler error, whereas
System.out.println((38 5 ) / 3 + " == " + 1 1);
is concatenated into a string?
I am wondering where exactly the error in the first line of code lies. Is it that 4 + ">"
are concatenated correctly and then some error occurs for 2 + (...)
?
New contributor
CharComplexity is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.