Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - How to convert string array into int array in java?
How to convert string array into int array in java?
1, you only need to write a for to convert them all.

2. If the length is the same as the array length of the previous string.

3. Have you seen the picture?

4. Look at the code

/**

* Shenzhen Haifeng Technology Co., Ltd.

* Date of creation: 2065438+June 22, 2008.

* Mail charles@hoifun.com

*/

Package com.itdugu.unit01.test1;

Import java.math.bigdecimal;

Public class Test2 {

public static void main(String[]args){?

String[] arr = {" 1 "," 2 "," 3 "," 3 " };

Integer[] iArr = new integer [arr.length];

for(int I = 0; I < array length; i++){

iArr[I]= integer . value of(arr[I]);

System.out.println ("test printing:"+IARR [I]);

}

}

}