Convert String to short primitive - Java Language Basics

Java examples for Language Basics:String

Description

Convert String to short primitive

Demo Code

 
public class Main {
  public static void main(String[] args) {
    String str = new String("10");
    short s = Short.parseShort(str);
    System.out.println(s);/* w w w  .j  a v  a 2s  .  com*/
  }
}

Result


Related Tutorials