Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Doubt in EL Operators.

 
sakthikumaran navakumar
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

Can you please explain the flow of control in the below given expression.

${ 3 ne 4 and 6 le 5 || false}
 
khushhal yadav
Ranch Hand
Posts: 242
Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Sakthikumaran Navakumar

First 3 ne 4 and 6 le 5 will be evaluated.
That means you will get something like
${true and false || false}
Now since the precedence of and is more than that of ||
So the expression will become
${false || false}

And the final answer will be
false

Regards,
Khushhal
 
Michael Ku
Ranch Hand
Posts: 510
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I see that you have passed certification for the Java language. The order of operations is the same in the EL as it is in Java itself.
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!