In Java, the logical condition OR behaves such that if the first condition true, then it does not evaluate the second condition.
For example:
int a = 10;
if (a == 10 || a == 0) {
}
Java does not evaluate the second test ( a == 0) as the first condition ( a == 10) true.
If we have an Oracle SQL statement:
select * from student where city = :city and
(:age is null or age > :age)
How are graded (age > :age or :age is null)? If the parameter :ageis equal NULL, then it also evaluates the second condition?
source
share