Win a copy of Java 9 Revealed this week in the Features new in Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Doubt in EL Operators.  RSS feed

 
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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!