How can I use a character in Java as an expression, like suppose I have an expression
char ch = '+';
so is it possible to perform addition using value of ch, without using if-else or switch or any thing like that?
I want to use ch
as expression. if ch = '+'
, then is it possible to do something like x = 5 ch 6
to calculate 5+6
?