convert string to short in java

convert string to short in java
refer to‮tual:‬turi.com
/**
 * @author lautturi.com
 * Java example: convert string to short java
 */

import java.util.*;

public class Lautturi {

	public static void main(String[] args) {

		String str1 = "-6";
		
		Short myShort1 = Short.valueOf(str1);
		System.out.println("Short:"+myShort1);

		String str2 = "32760";
		
		Short myShort2 = Short.valueOf(str2);
		System.out.println("Short:"+myShort2);

		String str3 = "32768";
		
		Short myShort3 = Short.valueOf(str3);
		System.out.println("Short:"+myShort3);
		
	}
}

output:

Short:-6
Short:32760
Exception in thread "main" java.lang.NumberFormatException: Value out of range. Value:"32768" Radix:10
	at java.base/java.lang.Short.parseShort(Short.java:122)
	at java.base/java.lang.Short.valueOf(Short.java:176)
	at java.base/java.lang.Short.valueOf(Short.java:202)
Created Time:2017-09-03 22:01:26  Author:lautturi