( String argv[] )
| 3 | public class callFromJava { |
| 4 | |
| 5 | public static void main( String argv[] ) throws EvalError { |
| 6 | |
| 7 | Interpreter interpreter = new Interpreter(); |
| 8 | interpreter.set("foo", 5); |
| 9 | interpreter.eval("bar = foo*10"); |
| 10 | Integer bar = (Integer)interpreter.get("bar"); |
| 11 | |
| 12 | if ( bar.intValue() != 50 ) |
| 13 | System.out.println("FAILED..."); |
| 14 | else |
| 15 | System.out.println("passed..."); |
| 16 | } |
| 17 | } |
| 18 |