What is the effect of evaluation of following expression? Select the one correct answer. ${'cat' gt 'cap'}
-
true
-
false
-
catcap
-
The expression does not compile as gt operator cannot be applied on strings.
The expression uses the 'gt' (greater than) operator for string comparison. String comparison in JSTL is lexicographic (alphabetical order). Since 'cat' comes after 'cap' alphabetically (comparing character by character: c=c, a=a, t>p), the result is true.
To answer this question, you need to understand the comparison operators in programming.
In the given expression, "gt" is a comparison operator that stands for "greater than". When comparing two strings using the "gt" operator, it checks if the first string is lexicographically greater than the second string.
In this case, the expression '${'cat' gt 'cap'}' will evaluate to true. This is because in lexicographical order, 'cat' comes after 'cap'. Therefore, the expression is true.
The correct answer is A) true.