previous | start | next

Example Notes

  1. This example uses yet another useful static method from the wrapper class Double. It converts the String parameter, str, to a double value and returns the double:

                double parseDouble(String str)
             
    
  2. At the end of main there is a call to the static method exit in the System class:

                void exit(int exitValue)
             
    

    This call will terminate a program whenever it is called. It can be placed in any method, not just main.

    It is useful when using JOptionPane dialogs to avoid a delay in program termination.



previous | start | next