Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within OCPJWCD
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Tim Cooke
paul wheaton
Liutauras Vilda
Ron McLeod
Sheriffs:
Jeanne Boyarsky
Devaka Cooray
Paul Clapham
Saloon Keepers:
Scott Selikoff
Tim Holloway
Piet Souris
Mikalai Zaikin
Frits Walraven
Bartenders:
Stephan van Hulst
Carey Brown
Forum:
Web Component Certification (OCEJWCD)
Doubt in EL
Shruthi Sam
Ranch Hand
Posts: 73
posted 15 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
In HFSJ, page no: 398
Given
Servlet
Code:
String num="2"; request.setAttribute("num", num); Integer i = new Integer(3); request.setAttribute("integer", i); java.util.ArrayList list = new java.util.ArrayList(); list.add("true"); list.add("false"); list.add("2"); list.add("10"); request.setAttribute("list", list);
The question is: The following will print what?
${list[0] || list["1"] and true }
The answer given is "true". Can anybody please clarify this?
What i thought was...
list[0] - true
list[1] - false
it will be ${true || false and true}
${true || false}
==> false
Please clarify.
Vijitha Kumara
Bartender
Posts: 4116
72
I like...
posted 15 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
${true || false}
==> false
Is that how "||" (logical OR) operator works?
SCJP 5 | SCWCD 5
[
How to ask questions
] [
Twitter
]
Shruthi Sam
Ranch Hand
Posts: 73
posted 15 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Oops....Sorry...
Thanks for pointing it out. Somehow i mistook.
Because those who mind don't matter and those who matter don't mind - Seuss. Tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
EL and Accessing request scope attributes
Trouble understanding evaluation of EL string literal
EL operator
EL arithmetic question
Doubt in HFSJ page-420
More...