title: Java Calculator using StringTokenizer
body: <p>I am developing a simple calc
  my input 3+3 </p>
  
  <p>I can do it with spaces(3 + 3) but how can I do it without spaces like (3+3)!</p>
  
  <p>this my last code I know it was wrong but I still learning !</p>
  
  <pre><code>package calcPkg;
  
  import java.util.Scanner;
  import java.util.StringTokenizer;
  
  public class test {
  
      public static void main(String[] args) {
  
          Scanner input = new Scanner(System.in);
          String myString = input.nextLine();
      String DELIM     = "+";
          double dblNum1   = 0;
          double dblNum2   = 0;
          double dblResult = 0;
  
          StringTokenizer st = new StringTokenizer(myString, DELIM, true);
  
          dblNum1 = Double.parseDouble(st.nextToken());
          //dblNum2 = Double.parseDouble(st.nextToken());
  
          dblNum2 = 2;
          dblResult = dblNum1 + dblNum2;
  
          while (st.hasMoreTokens())
              System.out.println(st.nextToken());
  
  
          System.out.println("First Number:" + dblNum1);
          System.out.println("Operation:" + DELIM);
          System.out.println("Second Number:" + dblNum2);
          System.out.println("Result:" + dblResult);
  
      }
  }
  </code></pre>