ArithmeticException Java?

Posted by KP65 on Stack Overflow See other posts from Stack Overflow or by KP65
Published on 2010-04-26T21:28:41Z Indexed on 2010/04/26 21:33 UTC
Read the original article Hit count: 178

Filed under:

Can anyone help me find where the execption is? I can't seem to find the problem..

  public void fieldChanged(Field f, int context){
        //if the submit button is clicked
        try{
            stopTime = System.currentTimeMillis();
            timeTaken = stopTime - startTime;
            timeInSecs = ((timeTaken/1000));
            speed = 45/timeInSecs;
            Dialog.alert("Speed of Delivery: " + speed + "mph");
            }
        catch(ArithmeticException e){
            Dialog.alert("error " + speed);
            e.printStackTrace();

        }

    } 

startTime variable is a global variable..

© Stack Overflow or respective owner

Related posts about java