How to convert component of String[] or Object[] to other type

This question already has an answer here:

  • How do I convert a String to an int in Java? 30 answers
  • Java - Convert integer to string [duplicate] 7 answers

  • You can use Integer.parseInt() without an issue.

    int i = input[0] // i is an int while input[0] is a String
    

    Now

    int i=Integer.parseInt(input[0])
    

    will convert String to int

    Integer.parseInt()

    链接地址: http://www.djcxy.com/p/20932.html

    上一篇: 如何将自定义方法添加到restangular服务?

    下一篇: 如何将String []或Object []的组件转换为其他类型