Convert String to short primitive in Java
Description
The following code shows how to convert String to short primitive.
Example
/*from w w w. ja v a 2 s. com*/
public class Main {
public static void main(String[] args) {
short s = Short.parseShort("10");
System.out.println(s);
}
}
The code above generates the following result.
Home »
Java Tutorial »
Java Data Type »
Java Tutorial »
Java Data Type »