The question Meg posted (page 430 - Q17) refers to Like expressions. If you check the EJB2.0 specification, page 230 says the following:
"The syntax for the use of the comparison operator [NOT] LIKE in a conditional expression is as follows:
single_valued_path_expression [NOT] LIKE pattern-value [ESCAPE escape-character]
The single_valued_path_expression must have a String value."
Although the question is not very clear, its asking whether the single_valued_path_expression used in LIKE expressions should result in String or not. As we can see from the specification it should, so the spoted alternative is indeed correct.
As I don't have the book anymore to check, I tried to remember what kind of expression was the question refering to and I thought it was about LIKE expressions. My bad. Now I know it refers to the IN expression. The question does not make it clear, but given the correct answers we see it was refering to the IN expression used in the WHERE clause. I say this because page 229 (botton) of the specification states the rules for IN expressions used in WHERE clauses:
"The syntax for the use of the comparison operator [NOT] IN in a conditional expression is as follows: single_valued_path_expression [NOT] IN (string-literal [, string-literal]* ) The single_valued_path_expression must have a String value."
So again, it expects a String value.
SCJP 1.4, SCBCD 1.3<br />IBM 141, 484, 486
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop