Suppose I have this method:
1. public int sum(int a, int b){
2. int x = 0;
3.
4. return x;
5. }
Is it possible to get a string x = a + b;
and place in line 3 (during runtime), so that after this string is inserted, the code now does the sum of a
and b
?
I wanna write some code in a text input field, so when I press a button, all that code (that is a string) should be able to go inside some part of some existing code. The sum
above is just an example but it can be anything.