Return system property as integer
static Integer getInteger(String nm)
- Get the system property.
static Integer getInteger(String nm, int val)
- Get the integer value of the system property with a default value.
static Integer getInteger(String nm, Integer val)
- Returns the integer value of the system property with a default value.
public class Main {
public static void main(String[] args) {
System.setProperty("myKey","10");
System.out.println(Integer.getInteger("myKey"));
}
}
The output:
10
Home
Java Book
Essential Classes
Java Book
Essential Classes
Integer:
- Integer class
- Max, min value of an integer type variable
- Create Integer using its constructors
- Return an integer value as byte, double, float, int, long and short
- Compare two integer values
- Decode a string and return an integer value
- Convert string to integer
- Convert integer to string
- Reverse and rotate the integer in binary format
- Bit oriented operation
- Return system property as integer
- Get the leading and trailing zeros
- Get the sign of an Integer
- Convert integer to binary, hexdecimal and octal format