I wonder how the below code return false.
String line ="";
if (line.length() > 0 && !line.startsWith("/*") || !line.startsWith("--")) {
return false;
}
What I know is if we use &&, execution starts from left and it proceeds only if left result is true, else it do not proceed.
but in the above code its returning false. The value of line.length() is 0, but its validating second condition and evaluating to true because the other two conditions are true and returning false.
Help me in understanding this operator.
Thank you.