java.lang Code Samples
- How do I remove substring from StringBuilder?
- How do I check if a character representing an alphabet?
- How do I decode string to integer?
- How do I get Java Home directory?
- How do I get super class of an object?
- How do I convert string to an integer or number?
- How do I get the name of current executed method?
- How do I add a delay in my program?
- How do I get Environment Variables?
- How do I check string for equality?
- How do I replace characters in string?
- How do I get user home directory name?
- How do I use for-each in Java?
- How do I read system property as an integer?
How do I decode string to integer?
The static Integer.decode() method can be use to convert a string
representation of a number into an Integer object. Under the cover
this method call the Integer.valueOf(String s, int radix).
The string can start with the optional negative sign followed with radix specified such as 0x, 0X, # for hexa decimal value, 0 (zero) for octal number.