The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
November 2000

Advertisement

Advertisement

This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.

Message:

RE:beginner needs help !!

Posted by Kishori Sharan on November 12, 2000 at 4:19 PM

String str = textField.getText ( ) ;
int num1 = Integer.parseInt (str);
float num2 = Float.parseFloat (str);
double num3 = Double.parseDouble (str);
All of these parse methods throws exception , so they have to be placed in try-catch block.




Replies:

Sponsored Links



Google
  Web Artima.com   
Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us