This seems basic, right? In most cases it is, but as almost everything in Java this problem has its subtle pitfalls and problems. It is mainly because Java does not provide a simple utility method that can answer this question. Today I wanted to share with you several ways of solving this problem and describe [...]
How to check if String is parseable to Integer or Double?
November 11, 2009 - Author: ppow
Categories: Basic Java, Strange behaviors
11 Comments
Archives
- May 2010 (2)
- April 2010 (1)
- March 2010 (1)
- December 2009 (1)
- November 2009 (8)
- October 2009 (5)
- September 2009 (6)
- August 2009 (9)
- July 2009 (7)
- June 2009 (4)
Recent Posts
- Java ClassLoader (4) – Loading a custom ClassLoader on JVM start
- Java ClassLoader (3) – Namespaces
- Java ClassLoader (2) – Write your own ClassLoader
- Java ClassLoader (1) – What is a ClassLoader?
- Internationalization with MessageFormat
- Scripting in Java
- Simple guide to Java Message Service (JMS) using ActiveMQ
- A guide to Java SimpleDateFormat in examples
- Using Java SecurityManager to grant/deny access to system functions
- How to check if String is parseable to Integer or Double?
Tags
Atomic
AtomicInteger
autoboxing
Bug
Catalyst
ClassLoader
Close
Code Quality
Collection
Comparable
CompareTo
Eclipse
equals method
File
Final
Finally
FindBugs
Generics
Global Variable
Hash Code
Internationalization
Java Compiler
Lazy Initialization
Locale
Map
Memory Leaks
MessageFormat
Micro Benchmarks
Pattern
Performance
Regular Expression
Remainder
serialization
Singleton
Split
String
Substring
Synchronization
toArray
Try/Catch
Type Erasure
Type safety
Welcome
wrapper classes
xml