• Post Reply Bookmark Topic Watch Topic
  • New Topic

Doubt in EL

 
Shruthi Sam
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In HFSJ, page no: 398

Given Servlet Code:



The question is: The following will print what?



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: 3954
21
Chrome Fedora Hibernate
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
${true || false}
==> false


Is that how "||" (logical OR) operator works?
 
Shruthi Sam
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oops....Sorry...

Thanks for pointing it out. Somehow i mistook.
 
Gravity is a harsh mistress. But this tiny ad is pretty easy to deal with:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!