Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Dynamic execution of boolean expression

807607Oct 9 2006 — edited Oct 9 2006
Hi folks,

I want to execute a boolean expression dynamically, can you pls help me how to do it.

For example,

String str = " ( X & ( Y | Z ) ) " ;

They value of X , Y or Z will be either true or false.

After replacing their value, I will get string as follow

String result = "( true & (false | true ) ".

Now I want to execute the String as boolean expression in order to get
a result as a true or false.

So, i need a solution to implement this. The expression may be simple or compound . It is so urgent waiting for your reply.

Appreciated if you provide sample code.

Thx !
With regards,
Rahul
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 6 2006
Added on Oct 9 2006
16 comments
795 views