Online Java Compiler By
JavaTpoint.com
public class ShortParseShortExample6 { public static void main(String[] args) { String x=" "; //String length is Zero . throw exception int radix=2; // it parse string as a signed short in the radix short shortValue = Short.parseShort(x,radix); System.out.println(" String "+x+" parsed specified by radix "+radix + " , into signed decimal short = "+ shortValue); } }
Output