Return | Method | Summary |
---|---|---|
static short | parseShort(String s) | Parses the string argument as a signed decimal short. |
static short | parseShort(String s, int radix) | Parses the string argument as a signed short in the radix specified by the second argument. |
static Short | valueOf(short s) | Returns a Short instance representing the specified short value. |
static Short | valueOf(String s) | Returns a Short object holding the value given by the specified String. |
static Short | valueOf(String s, int radix) | Returns a Short object holding the value extracted from the specified String when parsed with the radix given by the second argument. |
public class Main {
public static void main(String[] args) {
System.out.println(Short.parseShort("10"));
System.out.println(Short.parseShort("10",8));
System.out.println(Short.valueOf("10"));
System.out.println(Short.valueOf("10",8));
}
}
The output:
10
8
10
8
java2s.com | Contact Us | Privacy Policy |
Copyright 2009 - 12 Demo Source and Support. All rights reserved. |
All other trademarks are property of their respective owners. |