How to convert component of String[] or Object[] to other type
This question already has an answer here:
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