KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > nfunk > jepexamples > SimpleTest


1 /*****************************************************************************
2
3 JEP - Java Math Expression Parser 2.3.0
4       October 3 2004
5       (c) Copyright 2004, Nathan Funk and Richard Morris
6       See LICENSE.txt for license information.
7
8 *****************************************************************************/

9
10 package org.nfunk.jepexamples;
11 import org.nfunk.jep.*;
12
13 /**
14  * A seven line program for testing whether the JEP library can be found
15  * by the compiler and at run-time.<br>
16  * Upon successful compilation and running of the program, the program should
17  * print out one line: "1+2 = 3.0"
18  */

19 public class SimpleTest {
20     public static void main(String JavaDoc args[]) {
21         JEP myParser = new JEP();
22         myParser.parseExpression("1+2");
23         System.out.println("1+2 = " + myParser.getValue());
24     }
25 }
26
Popular Tags