wood burning stoves 2.0*
The moose likes Beginning Java and the fly likes Exception Question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Exception Question" Watch "Exception Question" New topic
Author

Exception Question

George Han
Greenhorn

Joined: Aug 17, 2005
Posts: 17
Is there an Excetion that means that it is not String? kinda like NumberFormatException?
Rick O'Shay
Ranch Hand

Joined: Sep 19, 2004
Posts: 531
Well, NumberFormatException means the string's not a number. Anything can have a string representation so it's not clear what you mean. You can have an empty string or a null string or a non-string in terms of a class other than string. Certainly there is NullPointerException (I guess Java does have pointers) and ClassCastException and IllegalArgumentException (of which NumberFormatException is a family member) but that's about it.
Kudret Serin
Ranch Hand

Joined: Aug 02, 2005
Posts: 167

why do you need this Exception?
George Han
Greenhorn

Joined: Aug 17, 2005
Posts: 17
Here is my code


Im tryign to loop it but I need to fix a problem When I press 3 after the first time and 3 again it doenst loop correctly.
Ramesh Shanmugam
Ranch Hand

Joined: Sep 13, 2004
Posts: 132
Number Format Exception will Mostly occur when you try to convert a string to a integer and if cant convert it to int the Exception will occur.


Ramesh Shanmugam - SCJP 1.5
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Exception Question