• Post Reply Bookmark Topic Watch Topic
  • New Topic

Doubt in EL  RSS feed

 
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.
 
Bartender
Posts: 4013
42
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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!